<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 02:59:14 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-2191] $push() to front of array</title>
                <link>https://jira.mongodb.org/browse/SERVER-2191</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;Currently $push() only pushes items onto the end of the array. &lt;br/&gt;
It would be nice if we could pass an optional boolean parameter that would allow pushing to the front of the array instead. &lt;/p&gt;

&lt;p&gt;This would allow reversing the order of arrays by nature of the front-push update, and would eliminate the need to do any client side sorting or reversing.&lt;br/&gt;
Currently adding array items atomically in reverse chronological order is not possible.&lt;/p&gt;

&lt;p&gt;This is similar to &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-2036&quot; title=&quot;$insert and $remove for arrays (currently $set, $unset, $push, and $pull are insufficient)&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-2036&quot;&gt;&lt;del&gt;SERVER-2036&lt;/del&gt;&lt;/a&gt;, and having an $insert() would accomplish the same thing. &lt;br/&gt;
But more specific and easier.&lt;/p&gt;</description>
                <environment></environment>
        <key id="13897">SERVER-2191</key>
            <summary>$push() to front of array</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="3">Duplicate</resolution>
                                        <assignee username="scotthernandez">Scott Hernandez</assignee>
                                    <reporter username="sym3tri">Ed Rooth</reporter>
                        <labels>
                    </labels>
                <created>Wed, 8 Dec 2010 09:26:06 +0000</created>
                <updated>Fri, 7 Mar 2014 00:03:15 +0000</updated>
                            <resolved>Tue, 1 Oct 2013 14:16:38 +0000</resolved>
                                                                    <component>Write Ops</component>
                                        <votes>8</votes>
                                    <watches>11</watches>
                                                                                                                <comments>
                            <comment id="107280" author="jonhsond" created="Fri, 6 Apr 2012 12:36:50 +0000"  >&lt;p&gt;This was not a question of usage (of the positional operator), I know how to do this.&lt;/p&gt;

&lt;p&gt;But a remark on how the positional operator becomes unsafe by the proposed new feature.&lt;/p&gt;</comment>
                            <comment id="106432" author="scotthernandez" created="Wed, 4 Apr 2012 12:43:38 +0000"  >&lt;p&gt;Your document is invalid and so is your update using &quot;$&quot;. I think you want this: &lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt; t.update( { &apos;_id&apos;:&apos;1&apos;, &quot;values.A&quot;:&quot;A&quot; }, { $inc:{ &apos;values.$.num&apos;:2 }}, false, true ) &lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt; where you have to use a query to find the array element you want to update using the positional operator.&lt;/p&gt;

&lt;p&gt;Please post on &lt;a href=&quot;http://groups.google.com/group/mongodb-user/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://groups.google.com/group/mongodb-user/&lt;/a&gt; if you have usage questions.&lt;/p&gt;</comment>
                            <comment id="106397" author="jonhsond" created="Wed, 4 Apr 2012 09:54:33 +0000"  >&lt;p&gt;What if I have an embedded array like this:&lt;br/&gt;
{ &lt;br/&gt;
   &quot;_id&quot; : &quot;1&quot;&lt;br/&gt;
   &quot;values&quot; : [ &lt;br/&gt;
      &quot;A&quot; : &lt;/p&gt;
{ &quot;A&quot;: &quot;A&quot;, &quot;num&quot; : 1 }
&lt;p&gt;,&lt;br/&gt;
      &quot;B&quot; : &lt;/p&gt;
{ &quot;B&quot;: &quot;B&quot;, &quot;num&quot; : 2 }
&lt;p&gt;,&lt;br/&gt;
      &quot;C&quot; : &lt;/p&gt;
{ &quot;C&quot;: &quot;C&quot;, &quot;num&quot; : 3 }
&lt;p&gt;   ]&lt;br/&gt;
}&lt;/p&gt;

&lt;p&gt;And I update one array element with the positional operator:&lt;br/&gt;
&lt;a href=&quot;http://www.mongodb.org/display/DOCS/Updating#Updating-The%24positionaloperator&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.mongodb.org/display/DOCS/Updating#Updating-The%24positionaloperator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;t.update( &lt;/p&gt;
{ &apos;_id&apos;:&apos;1&apos; }
&lt;p&gt;, { $inc:{ &apos;values.$.num&apos;:2 }}, false, true ).&lt;/p&gt;

&lt;p&gt;But now someone has reordered in between fetch and update, the update will match the wrong element in the array.&lt;/p&gt;

&lt;p&gt;So how are we supposed to update array elements safely when there is no support for natural Id&apos;s in mongo?&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="14225">SERVER-2363</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="43910">SERVER-6399</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>3.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 4 Apr 2012 09:54:33 +0000</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            11 years, 45 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>jonhsond</customfieldvalue>
            <customfieldvalue>sym3tri</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrpain:</customfieldvalue>

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

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

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