How to remove a document from the capped collection?

只愿长相守 提交于 2019-12-06 23:43:21

问题


When I try to remove a document in collection in MongoDB . It didn't remove because the collection is capped . My question is why? And is there a solution or other function can remove the document in this case?


回答1:


No You cannot delete documents from a capped collection. And there is no possible workaround. The only thing you can do is drop() the collection.




回答2:


You can not use remove function for capped collection. There are some restrictions on capped collections. Also you can refer this document for capped collection in mongoDB.



来源:https://stackoverflow.com/questions/33048282/how-to-remove-a-document-from-the-capped-collection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!