Last Updated: February 25, 2016
· squiter85

Force mongo to use a specific index

MongoDB automatically choose what index it uses in determinated queries, but you can specify what index you want mongoDB uses.
To specify the index, you can use the hint() method after your query:


You can force mongo to do not use any index too: