MongoDB - capture dropdowns from a compiled collection

Quote from MongoDB Docs in Capped Collections :

Once space is fully utilized, newly added objects will replace the oldest objects in the collection.

Is there a way to capture private collections of discarded objects before overwriting them? I am interested in implementing a series of funded collections. eg.

Hourly --> Daily --> Weekly --> Monthly etc. 

therefore, when an object falls out of watch collections, I want to capture it and merge it into a Daily collection.

Thanks in advance.

// Nikolay

+4
source share
2 answers

According to the MongoDB developers, you cannot do this:

http://groups.google.com/group/mongodb-user/browse_thread/thread/aec8d0c85f58d89e/d6701df083eb4679?fwc=1

What interests me is the implementation of a series of funded collections.

As alex said, one way to solve this problem is to use MapReduce. Another way is to have a different collection, for example. per day, for example logs20110414, and your application controls reading / writing to the appropriate collection.

+2
source

You will need to implement this functionality in code, not in MongoDB.

I do not think that Capped Collections is the right solution for your use case.

You can paste into a limited collection and at the same time paste into a โ€œregularโ€ collection and combine them into hourly / daily, weekly, monthly, etc .... by reducing the map.

+3
source

Source: https://habr.com/ru/post/1348121/


All Articles