我收到了這個奇怪的錯誤。我正在密切關注檔案,不明白我做錯了什么。我粘貼了一個最小的示例來復制錯誤。對此修復有任何提示嗎?
錯誤資訊:
TypeError:“集合”物件不可呼叫。如果您打算在 'Collection' 物件上呼叫 'dictinct' 方法,它會失敗,因為不存在這樣的方法。
代碼:
import pymongo
client = pymongo.MongoClient('mongodb://localhost:27017')
detached = client['realestate'].detached
print(detached.dictinct('key_facts-build_year'))
uj5u.com熱心網友回復:
你有一個錯字;方法是distinct()(不是dictinct())
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/456256.html
