You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MongoEngine Users
Hi,
How can I pass document attributes in variables to operators like
$set? I've tried this, but it looks like the __raw__ attribute is not
supported in update_one().
class Part(Document):
name = StringField()
foo = 'name'
# this should update the name attribute of the Part doc
Part.objects(...).update_one(__raw__={'$set' : {foo : 'bar'}})
Also, where can I found documentation on the underscore syntax?
Thanks
Ross Lawley
unread,
Feb 7, 2012, 6:59:36 AM2/7/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mongoeng...@googlegroups.com
Hi,
You can use update_one(set__FIELDNAME=value) - theres some examples here: