我想减轻我的生活,不要编写任何代码来查找集合中的一些文档,然后删除它们,我想通过使用mongo控制台来做到这一点:
$ db.collection.find({something here which has reutrn value }).find()
Run Code Online (Sandbox Code Playgroud)
我想做类似以下的事情:
$ db.collection.find({something here which has reutrn value }).find().remove()
Run Code Online (Sandbox Code Playgroud)
并且这是不可能的,那么在没有编码的情况下摆脱某些文档的最快方法是什么?或者不知道文件的ID?
这是您删除文档的方式:
db.things.remove({your_query});
Run Code Online (Sandbox Code Playgroud)
您可以先找到它们:
db.things.find({your_query}).pretty();
Run Code Online (Sandbox Code Playgroud)
请参阅http://www.mongodb.org/display/DOCS/Removing
| 归档时间: |
|
| 查看次数: |
3136 次 |
| 最近记录: |