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 AM6/16/11
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 AM6/16/11
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 AM10/2/14
to mongoeng...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages