Created
June 26, 2012 16:37
-
-
Save bootandy/2996950 to your computer and use it in GitHub Desktop.
pymongo - showing how to update multiple nested docs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def bulk_invite(self, user_ids, group_id, invite_message): | |
self.db['user_details'].update( { '_id' : { '$in' : user_ids } }, | |
{ '$set' : { 'group_invites.' + str(group_id) : invite_message} }, multi=True, safe=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment