MongoDB create index crash!

Hello everyone,
I have a problem when creating an index in Mongodb, the collection is many GB, the document contains about 100 million data, trying to create an index on it gives me the following error:

Error: error doing query: failed: network error while attempting to run command 'createIndexes' on 
host '127.0.0.1:27017'
DB.prototype.runCommand@src/mongo/shell/db.js:169:19
DBCollection.prototype.createIndexes@src/mongo/shell/collection.js:666:16
DBCollection.prototype.createIndex@src/mongo/shell/collection.js:644:12
@(shell):1:1

I am trying them all from both shell and compass:

db.collection1.createIndex({test: "text"})
db.collection1.createIndex({"test": 1},{unique:false})
db.collection1.createIndex({"test": 1},{sparse: true})
db.collection1.createIndex({test: 1},{background:true, sparse:true })

I also tried to reinsert the data into the collection, recreating it completely, and each time the index crashes around 1GB of creation. How could I solve? Where am I wrong in your opinion? Thank you all!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.