-
Type: New Feature
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Usability
-
None
-
(copied to CRM)
It would be nice to be able to schedule tasks/javascript functions to run inside mongo at fixed intervals (via the drivers).
This would make random jobs easier to code. Currently, I'm executing code that a cron calls via HTTP and this results in a bit of unnecessary framework code in my application.
Most databases support scheduled stored proc execution.
The ability to configure the scheduled proc so that it runs in parallel on shards, would be very handy too
E.g.
Once per minute, I would like to run:
- * * * * updateHostClusterIds
// Syntax may be off a bit
function updateHostClusterIds(currentTime, shardId) {
db.clusters.find().forEach( function(cluster) {
db.hosts.update({ _id: { $in :
}}, { $set: { clusterId : cluster._id }}, false, true);
});
}