0
文檔的結構如下:Pymongo中是否有複雜的查詢生成器?
{ "_id" : 1, "name" : "Demographics", "parent" : 0 }
我想要做像如下:
pyList=list(db.collection.find({"parent":0},{"_id":1}))
colList=list(db.collection.find({"parent":$in:[pyList]},{"name":1}))
因爲我已經實現了我的要求,但我相信,即使這不是最優的。 請直接給我任何這樣的框架mongodb在哪裏我可以寫一個查詢和我的要求將實現。
請溫柔一點,因爲我是新手。
您沒有包含代碼。 – Glyph
試試這個https://github.com/crossbario/autobahn-python/blob/master/examples/twisted/websocket/echo/server.py與包含文件夾中的一個客戶端變體。 – oberstet
我找到了解決方案,現在我不得不改變問題。 –