Jer*_*rry 7 mongodb mongoengine
结构体:
{title: 'test', comments: [{id:1, title: ''}, {id: 8, title: ''}]}
我需要删除id = 8项,谢谢.
您需要在此处使用 $pull 运算符:
http://www.mongodb.org/display/DOCS/Updating#Updating-%24pull
db.collection.update({'title':'test'},{$pull : { 'comments' : { 'id' : 8 }});
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
4223 次 |
最近记录: |