MongoDB Indexes
MongoDB provides a number of different index types to support specific types of data and queries. Indexes support the efficient execution of queries in MongoDB. MongoDB defines indexes at the collection level and supports indexes on any field or sub-field…
[MongoDB] : How Indexes works !
> use dbversitydb switched to db dbversitydb > > > for(i = 1; i <= 1000; i++) db.dbversity_website.insert( { post_id : i, comment_id : i, likes : i}); WriteResult({ “nInserted” : 1 }) > > > > db.dbversity_website.findOne() { “_id”…
[MongoDB]: How do we create indexes
Let’s say you have a query which takes around 120 ms to execute without indexes i can assure you that with proper indexes you can reduce that time by at least 10 times in MongoDB. Let me show you with…