我遇到包含解釋請求的問題。 作爲爲例以下請求工作良好:pymongo中的解釋(「executionStats」)的查詢
pp.pprint(col.find({"cuisine":"Italian"}, {"name" : 1, "address.zipcode" : 1, "address.coord" : 1}).explain())
的解釋方法的項目清單是公打印。
然而,當我想從解釋()方法,下面的請求只有executionStats項目:
pp.pprint(col.find({"cuisine":"Italian"}, {"name" : 1, "address.zipcode" : 1, "address.coord" : 1}).explain("executionStats"))
我有以下錯誤:
TypeError: explain() takes 1 positional argument but 2 were given
有誰知道它是什麼以及如何解決這個問題?
TY
格式,並請添加一些解釋 – GurV