Ability to schedule javascript functions to run @ cron like intervals on the server

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Won't Fix
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Usability
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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 :

      { cluster.hostIds }

      }}, { $set: { clusterId : cluster._id }}, false, true);
      });
      }

            Assignee:
            Unassigned
            Reporter:
            Ryan Nitz
            Votes:
            10 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: