简体   繁体   中英

Why '$pull' does not work in cherrypy

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

包裹$pull引号:

'$pull': {...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM