<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:07:43 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-5039] Mongo Shell should support concept of module loading.</title>
                <link>https://jira.mongodb.org/browse/SERVER-5039</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;While load() is fine for loading and executing an external javascript script, if we&apos;re going to move the shell towards being a more general purpose testing and scripting environment, it&apos;s going to need a system for loading modules that can track what modules are already loaded, and avoid reloading them, and a convention for avoiding polluting the global namespace.&lt;/p&gt;

&lt;p&gt;I&apos;m familiar with the module system from Dojo (dojotoolkit.org).  The commonjs initiative (commonjs.org) also has a specification for module loading, for which implementations may be available.&lt;/p&gt;</description>
                <environment></environment>
        <key id="31229">SERVER-5039</key>
            <summary>Mongo Shell should support concept of module loading.</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="9">Done</resolution>
                                        <assignee username="backlog-server-platform">DO NOT USE - Backlog - Platform Team</assignee>
                                    <reporter username="schwerin@mongodb.com">Andy Schwerin</reporter>
                        <labels>
                            <label>move-sa</label>
                            <label>platforms-re-triaged</label>
                    </labels>
                <created>Wed, 22 Feb 2012 15:37:36 +0000</created>
                <updated>Fri, 17 Jul 2020 15:37:45 +0000</updated>
                            <resolved>Fri, 17 Jul 2020 15:37:45 +0000</resolved>
                                                                    <component>JavaScript</component>
                    <component>Shell</component>
                                        <votes>3</votes>
                                    <watches>5</watches>
                                                                                                                <comments>
                            <comment id="3290044" author="jessica.sigafoos" created="Fri, 17 Jul 2020 15:37:45 +0000"  >&lt;p&gt;The new shell is built on top of the node.js repl, and therefore supports the native node.js module system, where you can load external packages with require.&lt;/p&gt;</comment>
                            <comment id="173569" author="rsdoiel" created="Wed, 10 Oct 2012 22:35:11 +0000"  >&lt;p&gt;I think this can be implemented without directly changing the Mongo shell (at least until the shell is improved).  I&apos;ve implemented a prototype module system using NodeJS&apos;s require syntax.  I bootstrap it from the .mongorc.js file (though invoking a script to run with the shell requires that the first command line argument is .mongorc.js).  It is mostly a proof of concept though I am using it for some modules where I want code to run real time in NodeJS and run batch via Mongo&apos;s shell.&lt;/p&gt;

&lt;p&gt;The URL for my project is: &lt;a href=&quot;https://github.com/rsdoiel/mongo-modules&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/rsdoiel/mongo-modules&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This would be much easier to implement if Mongo&apos;s shell supported a couple of features:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;.mongorc.js file should be loaded without specifying on the command line (like when you use the Mongo shell as a repl)&lt;/li&gt;
	&lt;li&gt;Access to the command line args invoked when launching the shell&lt;/li&gt;
	&lt;li&gt;A variable should expose which module/file is being run (e.g. mongo ~/.mongorc.js my-batch-prog.js would set something like process.filename where process.filename is the file being processed at the moment)&lt;/li&gt;
	&lt;li&gt;Oddly there is no built in JSON object so parsing a package.json to bootstrap the module will require using something like Doug Crockford&apos;s JSON non-eval parser.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;I think if I knew which file I was in I could create enough environmental data to make a NodeJS compatible module system (as far as pure JS goes).  Anyone interested?&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Robert&lt;/li&gt;
&lt;/ul&gt;

</comment>
                            <comment id="91227" author="eliot" created="Thu, 23 Feb 2012 05:42:59 +0000"  >&lt;p&gt;Can also use something like:&lt;br/&gt;
&lt;a href=&quot;http://code.google.com/p/gpsee/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://code.google.com/p/gpsee/&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="90964" author="renctan" created="Wed, 22 Feb 2012 18:37:11 +0000"  >&lt;p&gt;The Google closure library also have a module framework that has a mechanism for including js files and their dependencies. It also supports declaring and using &apos;namespaces&apos;. It is also open source so that means we can pull off only the subset of relevant files from the project.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="138729">SERVER-14072</issuekey>
        </issuelink>
                            </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_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 22 Feb 2012 18:37:11 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        3 years, 29 weeks, 5 days 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_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>jessica.sigafoos@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            3 years, 29 weeks, 5 days 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>schwerin@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-platform</customfieldvalue>
            <customfieldvalue>eliot</customfieldvalue>
            <customfieldvalue>jessica.sigafoos@mongodb.com</customfieldvalue>
            <customfieldvalue>randolph@mongodb.com</customfieldvalue>
            <customfieldvalue>rsdoiel</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrocqv:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>4809</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|ht0ovb:</customfieldvalue>

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