<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:04:39 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-3998] It&apos;s trivial to make the new &quot;edit&quot; function work on Windows</title>
                <link>https://jira.mongodb.org/browse/SERVER-3998</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;I was curious why the new &quot;edit&quot; function in the shell wasn&apos;t supported in Windows, so I tried taking out the #ifndef _WIN32 code that is hiding the function and making minor adjustments for Windows.  It took 5 minutes to get it working.  Windows isn&apos;t crazy about editing a file that is still open by the shell, but notepad let me overwrite the file anyway and I got my edited values back in the shell just fine.  I think that closing and reopening the file (at least in Windows) is the better way to go rather than letting the editor operate on a file we still have open.  I tweaked the filename generation slightly for Windows:&lt;/p&gt;

&lt;p&gt;#ifdef _WIN32&lt;br/&gt;
        char tempFolder&lt;span class=&quot;error&quot;&gt;&amp;#91;MAX_PATH&amp;#93;&lt;/span&gt;;&lt;br/&gt;
        GetTempPathA(sizeof tempFolder, tempFolder);&lt;br/&gt;
        sb &amp;lt;&amp;lt; tempFolder &amp;lt;&amp;lt; &quot;mongo_edit&quot; &amp;lt;&amp;lt; time(0)+i &amp;lt;&amp;lt; &quot;.js&quot;;&lt;br/&gt;
#else&lt;br/&gt;
        sb &amp;lt;&amp;lt; &quot;/tmp/mongo_edit&quot; &amp;lt;&amp;lt; time(0)+i &amp;lt;&amp;lt; &quot;.js&quot;;&lt;br/&gt;
#endif&lt;/p&gt;

&lt;p&gt;and I had to comment out the use of File to do the delete because &quot;fd&quot; is private in the Windows build, so my hack needs more work.  The file isn&apos;t deleted with my quick hack, but that&apos;s easy to fix if we want to enable this feature in Windows.&lt;/p&gt;

&lt;p&gt;    // just to make sure this gets closed no matter what&lt;br/&gt;
#ifndef _WIN32&lt;br/&gt;
    File holder;&lt;br/&gt;
    holder.fd = fd; // can&apos;t do this in windows because holder.fd is private&lt;br/&gt;
#endif&lt;/p&gt;

&lt;p&gt;I was thinking that I might need to use ShellExecute() to run the program, but ::system() works fine.  No #ifdef required.&lt;/p&gt;

&lt;p&gt;    StringBuilder sb;&lt;br/&gt;
    sb &amp;lt;&amp;lt; editor &amp;lt;&amp;lt; &quot; &quot; &amp;lt;&amp;lt; filename;&lt;br/&gt;
    int ret = ::system(sb.str().c_str());&lt;br/&gt;
    int systemErrno = errno;&lt;/p&gt;

&lt;p&gt;I set Visual Studio to pass --nodb on the command line and EDITOR=notepad.exe as an environment variable and except for the complaint from notepad that &quot;The file is open in another process&quot; it just worked.&lt;/p&gt;

&lt;p&gt;MongoDB shell version: 2.1.0-pre-&lt;br/&gt;
&amp;gt; f={}&lt;br/&gt;
{ }&lt;br/&gt;
&amp;gt; edit f  // notepad runs, complains about open file, brings up Save As dialog, asks permission to overwrite, then writes file&lt;br/&gt;
&amp;gt; f&lt;/p&gt;
{ &quot;key&quot; : &quot;value&quot; }
&lt;p&gt;&amp;gt; // it worked&lt;/p&gt;</description>
                <environment>Windows</environment>
        <key id="23129">SERVER-3998</key>
            <summary>It&apos;s trivial to make the new &quot;edit&quot; function work on Windows</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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="tad">Tad Marshall</assignee>
                                    <reporter username="tad">Tad Marshall</reporter>
                        <labels>
                            <label>rn</label>
                    </labels>
                <created>Sun, 2 Oct 2011 14:30:03 +0000</created>
                <updated>Mon, 11 Jul 2016 18:32:23 +0000</updated>
                            <resolved>Sun, 27 Nov 2011 15:05:36 +0000</resolved>
                                                    <fixVersion>2.1.0</fixVersion>
                                    <component>Shell</component>
                                        <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                <comments>
                            <comment id="69061" author="tad" created="Sun, 27 Nov 2011 15:05:36 +0000"  >&lt;p&gt;Fixed by commit 2cad4df74dd544273fc23d0fb69429766e29a446 .&lt;/p&gt;</comment>
                            <comment id="69060" author="auto" created="Sun, 27 Nov 2011 14:58:01 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;login&apos;: u&apos;&apos;, u&apos;name&apos;: u&apos;Tad Marshall&apos;, u&apos;email&apos;: u&apos;tad@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-3998&quot; title=&quot;It&amp;#39;s trivial to make the new &amp;quot;edit&amp;quot; function work on Windows&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-3998&quot;&gt;&lt;del&gt;SERVER-3998&lt;/del&gt;&lt;/a&gt; &amp;#8211; enable the shell&apos;s edit command in Windows&lt;/p&gt;

&lt;p&gt;Make the mongo shell&apos;s &apos;edit&apos; command work in Windows.  Change&lt;br/&gt;
the code to use C file stream functions instead of Unix low level&lt;br/&gt;
IO (fopen instead of open), close and reopen the file so there are&lt;br/&gt;
fewer OS dependencies, delete (remove()) the file ourselves where&lt;br/&gt;
needed.  Also, remove #ifdefs are are now constant (USE_LINENOISE,&lt;br/&gt;
USE_TABCOMPLETION) and the unused code they supported, and try to&lt;br/&gt;
get the entire source file to adhere to the kernel code style.&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/2cad4df74dd544273fc23d0fb69429766e29a446&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/2cad4df74dd544273fc23d0fb69429766e29a446&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                            <outwardlinks description="related to">
                                        <issuelink>
            <issuekey id="22020">SERVER-3787</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Sun, 27 Nov 2011 14:58:01 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 12 weeks, 3 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>ramon.fernandez@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            12 years, 12 weeks, 3 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>auto</customfieldvalue>
            <customfieldvalue>tad</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hroozj:</customfieldvalue>

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

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

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