I want to update thousands of documents in mongo collection. I want to find them using ObjectId and then whichever document matches , should be updated. My update is same fo
bulk = db.testdata.initialize_unordered_bulk_op()
for i in range (0, len(ids)):
bulk.find( { '_id': ids[i]}).update({ '$set': { "isBad" : "N" }})
print bulk.execute()