MongoDB中的事件调度程序(cronjob)? [英] Event scheduler (cronjob) in MongoDB?

查看:159
本文介绍了MongoDB中的事件调度程序(cronjob)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Mongodb中设置事件?

我将创建一个事件,该事件每4小时计算一次字段"(SUM | COUNT),然后将其保存并保存. 达到此目的的最佳解决方案是什么? 谢谢:)

I will create an event that every 4 hours Calculate fields (SUM|COUNT) in the Collection And Save it. What is the best Solution to arrive this? thanks:)

推荐答案

从3.2版开始,MongoDB没有内置的cronjob系统(TTL索引自动删除作业除外,但是这些无法帮助您解决此问题)问题).

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).

这意味着您将必须使用外部工具以查询作为参数启动mongo shell.有无数工具可用于此目的,一些工具可直接使用在所有常见操作系统中,而某些工具则以第三方工具的形式提供.列出所有选项的方法太多了,哪一种是最好的取决于您的IT基础架构以及系统管理员的喜好.

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.

这篇关于MongoDB中的事件调度程序(cronjob)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆