Running findAndModify fails with certain queries #18

patrickod opened this Issue Sep 30, 2011 · 0 comments


1 participant

When running findAndyModify commands with a SON object in the following context the query argument is put at the start of the SON object thus causing an error with Mongo

from bson.son import SON
from bson import ObjectId
q = SON()
q['findAndModify'] = 'collection'
q['query'] = {"_id" : ObjectId("valid-object-id")}

database.command(q, callback=callback)

The SON object is re-ordered putting the query item in front of findAndModify and thus the query fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment