Groups
Groups
Sign in
Groups
Groups
MongoEngine Users
Conversations
About
Send feedback
Help
How to use 'unset' to remove a field?
2,027 views
Skip to first unread message
Frank DU
unread,
Jun 16, 2011, 3:30:20 AM
6/16/11
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
Dear All,
I am wondering how to 'unset' to remove a field. Let's say the class is UserItem, and the filed name is 'desc_text'. Is below official syntax:
UserItem.objects(id=
u.id
).updateOne(unset_desc_text=None)
Please confirm or help this issue. Thank you so much!
Best,
Frank
Ross Lawley
unread,
Jun 16, 2011, 4:00:47 AM
6/16/11
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,
This should work:
UserItem.objects(id=
u.id
).updateOne(unset__desc_text=1)
Ross
Anand Sainath
unread,
Oct 2, 2014, 8:30:17 AM
10/2/14
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
Similar questions - How would I do this -
http://stackoverflow.com/questions/26151632/removing-a-column-from-a-dictfield-in-mongodb-flask-mongoengine
?
Reply all
Reply to author
Forward
0 new messages