Reputation: 3308
I used $pull
for removing a field in embedded document in mongodb. i used cherrypy to implemet this. this is my code.
models.login_info.update({},{$pull:{location:{time:date}}})
but while i run this code it gives me lexical error as follows.
Lexical error at line 48, column 39. Encountered: "$" (36), after : ""
in the terminal i get the following error notification
models.login_info.update({},{$pull:{location:{time:date}}})
^
SyntaxError: invalid syntax
Upvotes: 1
Views: 230