Mongodb is automatically written to a limited collection

I need to manage the acquisition of many records per hour. About the 1000000records. And I need to get every second the last insertion value for each primary key. It works great with shards. I was thinking of trying to use the os capped collection to get only the last record for each primary key. To do this, I made two separate inserts, is there a way, in mongodb, to make some kind of trigger to distribute the insert into the collection into another collection?

+3
source share
2 answers

MongoDB does not support triggers or similar behavior.

- . , , , .

. , , .

+5

"". , MongoDB , , . .

, .

+3

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


All Articles