为什么我不能在MongoDB更新上运行解释? [英] Why can't I run explain on MongoDB update?
本文介绍了为什么我不能在MongoDB更新上运行解释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正试图解释mongoDB的更新;但是什么都没发生?蒙戈不支持吗?
I'm trying to explain a mongoDB update; but nothing is happening? Does Mongo not support this?
> db.movies.update({"actors.name": "Christian Bale"}, {$set: {"actors.$.name": "Christina Bale"}}, {$explain: 1});
>
我尝试使用.explain()
和._addSpecial("$explain", 1")
进行其他变体.两者都会产生以下错误:
I've tried other variations using .explain()
and ._addSpecial("$explain", 1")
. Both of these produce the following error:
Thu Aug 1 11:26:46.368 JavaScript执行失败:TypeError:无法调用未定义的方法"explain"
Thu Aug 1 11:26:46.368 JavaScript execution failed: TypeError: Cannot call method 'explain' of undefined
推荐答案
我相信以下内容将使您可以对查询进行解释.
I believe the following will allow you to call explain on your query.
db.movies.explain().update({your_query})
希望这会有所帮助,如果您需要更多信息,请告诉我.
Hope this helps, if you need more info let me know.
这篇关于为什么我不能在MongoDB更新上运行解释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文