How do I do an explain on a mongo query through meteor?


#1

Is there a way to do this? or do I have to translate my query into something I can run in the mongo shell directly and then do the .explain() on that?


#2

Need to do it through the mongo shell, as far as I’m aware.


#3

OK, thanks… considering the syntax is different sometimes, it would be nice to be able to get it inside the meteor framework…


#4

You can do it by:
Collection.find( { $query: {'some': 'query'}, $explain: 1 } ).fetch()

Cheers :slight_smile: