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?
Capped collections are fixed-size collections that support high-throughput operations that insert and retrieve documents based on insertion order.
Capped collections restrict updates to the documents if the update results in increased document size. Since capped collections store documents in the order of the disk storage, it ensures that the document size does not increase the size allocated on the disk.
You can check whether a collection is capped using the isCapped() method. This method returns true as the output if the specified collection is a capped one. Otherwise, it returns false.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With