If I pass an invalid row, it throws an exception. I would like it to return NULL so I can use it to further process the rest of my scripts.
module_id = module_id
mongo_document = mongo_collection.find_one({ '_id': '%s' % module_id}, { '_id':0, 'svn_path':1 })
myvar = mongo_document
for key, value in myvar.iteritems():
print value
Exception?find_onemight returnNonealready if no matching collections are found. github.com/mongodb/mongo-python-driver/blob/master/pymongo/…, ismyvarNone? and you are trying to calliteritemsonNone?