<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:00:25 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-2573] Ability to schedule javascript functions to run @ cron like intervals on the server</title>
                <link>https://jira.mongodb.org/browse/SERVER-2573</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;It would be nice to be able to schedule tasks/javascript functions to run inside mongo at fixed intervals (via the drivers).&lt;/p&gt;

&lt;p&gt;This would make random jobs easier to code. Currently, I&apos;m executing code that a cron calls via HTTP and this results in a bit of unnecessary framework code in my application.&lt;/p&gt;

&lt;p&gt;Most databases support scheduled stored proc execution.&lt;/p&gt;

&lt;p&gt;The ability to configure the scheduled proc so that it runs in parallel on shards, would be very handy too &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.mongodb.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;E.g.&lt;/p&gt;

&lt;p&gt;Once per minute, I would like to run:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;* * * * updateHostClusterIds&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;// Syntax may be off a bit&lt;/p&gt;

&lt;p&gt;function updateHostClusterIds(currentTime, shardId) {&lt;br/&gt;
    db.clusters.find().forEach( function(cluster) {&lt;br/&gt;
         db.hosts.update({ _id: { $in : &lt;/p&gt;
{ cluster.hostIds }
&lt;p&gt;}}, { $set: { clusterId : cluster._id }}, false, true);&lt;br/&gt;
    });&lt;br/&gt;
}&lt;/p&gt;</description>
                <environment></environment>
        <key id="14766">SERVER-2573</key>
            <summary>Ability to schedule javascript functions to run @ cron like intervals on the server</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="rn@deftlabs.com">Ryan Nitz</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Feb 2011 23:32:26 +0000</created>
                <updated>Mon, 19 Aug 2019 23:49:31 +0000</updated>
                            <resolved>Wed, 24 Jun 2015 17:08:17 +0000</resolved>
                                                                    <component>Usability</component>
                                        <votes>10</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="949460" author="ian@10gen.com" created="Wed, 24 Jun 2015 17:08:17 +0000"  >&lt;p&gt;As per Eliot&apos;s previous comment, this is not something that we currently plan to include in MongoDB.&lt;/p&gt;</comment>
                            <comment id="72198" author="tronlightyear" created="Sat, 10 Dec 2011 22:10:14 +0000"  >
&lt;p&gt;This is a feature that I am kind of looking for as well---but not for running MR jobs (use cron, ActiveBatch, etc for those). There are specific tasks of the DB admin kind that I periodically need to run. Currently, these are either JS or pymongo and executed by cron(1) since I have no other options. It works, but it does not sit well with me. Why?&lt;/p&gt;

&lt;p&gt;Mongo security:  in one way or another, I have to store an admin login (id and credentials) &quot;somewhere&quot; the scripts being executed can get to them and pass them on to MongoDB to authenticate. Filesystem ACL, platform-specific secure storage (etc) are simply not a readily workable nor sufficiently secure solution.&lt;/p&gt;

&lt;p&gt;What I&apos;d like to see is the ability for an authenticated user to be able to internally upload/schedule JS code to run at specific intervals or schedules and do so in the security context of the script&apos;s owner (or perhaps, in the superuser case, designate a specific context). Being &quot;all internal&quot; to the database, the authentication issue is greatly diminished (assuming implementation is rock solid).&lt;/p&gt;

</comment>
                            <comment id="24114" author="gerhardb" created="Thu, 17 Feb 2011 14:10:27 +0000"  >&lt;p&gt;Would be a nice feature for long-running MapReduce Jobs, e.g. statistical data mining once a day. Should be full viewable and configurable per JS console and per driver imho.&lt;/p&gt;</comment>
                            <comment id="24068" author="eliot" created="Wed, 16 Feb 2011 23:41:48 +0000"  >&lt;p&gt;Not sure this is something that belonds in a db&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_13552" key="com.go2group.jira.plugin.crm:crm_generic_field">
                        <customfieldname>Case</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[[5002K00000dYOL3QAO, 5002K00000g6722QAA]]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 16 Feb 2011 23:41:48 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        8 years, 34 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            8 years, 34 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>tronlightyear</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>gerhardb</customfieldvalue>
            <customfieldvalue>ian@mongodb.com</customfieldvalue>
            <customfieldvalue>rn@deftlabs.com</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrp5wf:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrg0b3:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6590</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hs5izj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>