Event scheduler (cronjob) in MongoDB?

后端 未结 2 1493
再見小時候
再見小時候 2021-01-25 06:00

How can i set an event in Mongodb?

I will create an event that every 4 hours Calculate fields (SUM|COUNT) in the Collection And Save it. What is the best So

2条回答
  •  感情败类
    2021-01-25 06:26

    As of version 3.2 MongoDB has no buildin cronjob system (with the exception of the TTL index auto-delete jobs, but these won't help you to solve this problem).

    That means you will have to use an external tool to start the mongo shell with your query as a parameter to it. There are countless tools available for this, some build into all common operating systems out-of-the box and some in form of 3rd party tools. There are far too many options to list them all and which one is the best depends on your IT infrastructure and what your system administrators prefer.

提交回复
热议问题