Mongodb findOne with explanation

Is it possible to find findOne with an explanation in mongodb?

I have currently tried:

db.coll.findOne({query}).explain() db.collection.findOne({query})._addSpecial( "$explain", 1 ) 

and both were not successful.

I understand that I can make restriction 1, but can this be done without it?

+6
source share

Source: https://habr.com/ru/post/969818/


All Articles