Answer the question
In order to leave comments, you need to log in
Indexes in MongoDB?
Good afternoon!
I would like to ask.
For example, there is a collection = {name, age}
I create indexes
db.users.createIndex( { name: 1, age: -1 } )
When I start the application, db.users.createIndex( { name: 1, age: -1 }) is always executed ) (Well, logically)
Does this affect performance?
Maybe I need to first create indexes through mongo in the terminal?
Answer the question
In order to leave comments, you need to log in
If you call multiple createIndex() methods with the same index specification at the same time, only the first operation will succeed, all other operations will have no effect.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question