user3504250 user3504250 - 11 days ago 6x
Python Question

TypeError: unsupported operand type(s) for +: 'Cursor' and 'Cursor'

I want to be able to store two collections in variable to be able to view and sort through them. However, I seem to be getting the error above.
My code is in python and look like this:

from pymongo import MongoClient

db = MongoClient('', 27017)['mean-dev']
cursor1 = db.Build_Progress.find()
cursor2 = db.build_lookup.find()
joincursors = cursor1+ cursor2

for document in cook:


You need to chain the two cursors like this:

from itertools import chain

for document in chain(cursor1, cursor2):