您如何在MongoDB中解释一个独特的查询? [英] How do you explain a distinct query in MongoDB?
本文介绍了您如何在MongoDB中解释一个独特的查询?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您如何在MongoDB中解释一个独特的查询?
How do you explain a distinct query in MongoDB?
db.test3.distinct("id", { key:"value"}).explain()
错误:
explain is not a function (shell)
推荐答案
从Mongo 3.2开始,您可以执行以下操作:
As of Mongo 3.2, you can do:
db.test3.explain().distinct("id", {key: "value"})
https://docs.mongodb.org/manual/reference /method/db.collection.explain/
这篇关于您如何在MongoDB中解释一个独特的查询?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文