我希望能够在变量中存储两个集合,以便能够查看和排序它们。但是,我似乎得到了上面的错误。 我的代码是在python中,看起来像这样:
from pymongo import MongoClient
db = MongoClient('10.39.165.193', 27017)['mean-dev']
cursor1 = db.Build_Progress.find()
cursor2 = db.build_lookup.find()
joincursors = cursor1+ cursor2
for document in cook:
print(document)
答案 0 :(得分:0)
你需要chain
这两个游标:
from itertools import chain
for document in chain(cursor1, cursor2):
print(document)