Skip to content
This repository

Running findAndModify fails with certain queries #18

Open
patrickod opened this Issue September 30, 2011 · 0 comments

1 participant

Patrick O'Doherty
Patrick O'Doherty

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
Something went wrong with that request. Please try again.