Even using mongoose.set('debug', true);
does not explain if queries used indexes or not, How can I know if they did?
Asked
Active
Viewed 951 times
3

omidh
- 2,526
- 2
- 20
- 37
-
http://stackoverflow.com/questions/35019313/checking-if-an-index-exists-in-mongodb – GillesC Nov 29 '16 at 17:21
-
1Possible duplicate of [How do I check if an index is being used](http://stackoverflow.com/questions/24535439/how-do-i-check-if-an-index-is-being-used) – xShirase Nov 29 '16 at 17:24
-
@GillesC That's not what I want, I want something like Mongodb.explain method – omidh Nov 29 '16 at 17:24
-
short answer : you can't. long answer, see my link :) – xShirase Nov 29 '16 at 17:25
1 Answers
1
Perhaps you can use this mongoose plugin mongoose-explain. If not, then you will have to continue to do mongoose.set('debug', true);
and copy and paste logged queries to the mongodb shell and issue an explain()
there.

Corey Berigan
- 614
- 4
- 14