I am trying to do the following:
def get_collection_iterator(collection_name, find={}, criteria=None): collection = db[collection_name]
and caller:
def get_collection(): criteria = {'unique_key': 0, '_id': 0} for document in Mongo.get_collection_iterator('contract', {}, criteria): print document
and I see an error:
File "/Users/Dev/Documents/work/dw/src/utilities/Mongo.py", line 96 yield doc SyntaxError: 'return' with argument inside generator
what am i doing wrong here?
source share