我可以看到.explain(“ executionStats”)来评估Mongo中find()查询的性能。但是.explain在findOneAndUpdate()上不起作用。有没有办法查看索引在帮助findOneAndUpdate()查询方面有多大作用
在explain(“ executionStats”)中。您只需删除“ executionStas”并运行您的findOneAndUpdate查询,如下所示:
'''db.collection.explain()。findOneAndUpdate({query})'''
它将正常工作...