linvodb3
linvodb3 copied to clipboard
Capped collections
LinvoDB needs to support capped collections, like MongoDB
With the events system, this shouldn't be too hard to implement as an add-on module. The logic will be:
- when new documents are inserted (listen to the
insertedevent - lookup an index we'll be capping on directly (.indexes[idxName]. ...) - e.g. an index by mtime or ctime
- take the documents of this index which are not in the first N (cap size) and remove them with Doc.remove()
Capped collections would be a great addition.