<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:28:48 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-12537] Support $slice/sort in $addToSet</title>
                <link>https://jira.mongodb.org/browse/SERVER-12537</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-991&quot; title=&quot;$push with $slice + $sort&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-991&quot;&gt;&lt;del&gt;SERVER-991&lt;/del&gt;&lt;/a&gt; is about adding $slice to $push, but &lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=scotthernandez&quot; class=&quot;user-hover&quot; rel=&quot;scotthernandez&quot;&gt;scotthernandez&lt;/a&gt; says it should also be supported for $addToSet (or throw an error).&lt;/p&gt;</description>
                <environment></environment>
        <key id="108272">SERVER-12537</key>
            <summary>Support $slice/sort in $addToSet</summary>
                <type id="4" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14710&amp;avatarType=issuetype">Improvement</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="backlog-server-query">Backlog - Query Team</assignee>
                                    <reporter username="glenn">Glenn Maynard</reporter>
                        <labels>
                            <label>operations</label>
                    </labels>
                <created>Wed, 29 Jan 2014 22:06:56 +0000</created>
                <updated>Tue, 6 Dec 2022 05:12:30 +0000</updated>
                            <resolved>Sat, 29 Jun 2019 07:56:32 +0000</resolved>
                                    <version>2.4.0-rc0</version>
                                                    <component>Write Ops</component>
                                        <votes>3</votes>
                                    <watches>7</watches>
                                                                                                                <comments>
                            <comment id="2305643" author="asya" created="Sat, 29 Jun 2019 07:56:32 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-40381&quot; title=&quot;Add the ability to specify a pipeline to an update command&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-40381&quot;&gt;&lt;del&gt;SERVER-40381&lt;/del&gt;&lt;/a&gt; implemented support for aggregation expressions to specify update for 4.2.&#160;&lt;/p&gt;

&lt;p&gt;You can see some examples &lt;a href=&quot;https://docs.mongodb.com/master/reference/command/update/index.html#update-command-example-agg&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;here.&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What remains to completely support use case in this ticket would be &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-29425&quot; title=&quot;Add an expression to sort an array&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-29425&quot;&gt;&lt;del&gt;SERVER-29425&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1577599" author="rshumate@flexgen.com" created="Tue, 23 May 2017 13:17:10 +0000"  >&lt;p&gt;This would be useful in managing time series data in my schema design. We&apos;re handling millisecond resolution data that is stored in an array {&apos;ts&apos;: ISODate(&quot;2017-05-23T10:50:00.0&quot;), &apos;data&apos;: [&lt;/p&gt;
{&apos;ms&apos;:1520, &apos;value&apos;:5.1351]}
&lt;p&gt;. We&apos;d prefer to use $addToSet over $push so that we can ignore duplicate entries for the same timestamp. However, using $addToSet doesn&apos;t allow us to sort the data on entry like $push. This requires an application side sort which is time consuming. Performing the sort on insert the same as $push would be very beneficial.&lt;/p&gt;</comment>
                            <comment id="490501" author="glenn" created="Wed, 29 Jan 2014 22:36:26 +0000"  >&lt;p&gt;I&apos;ve hit it a couple times.  A simple example is storing a limited number of recently-seen IDs, for things like detecting accidental double-submission of an action.  That&apos;s not exactly an MRU, since there&apos;s no need to move IDs which were already in the list to the end.  (Of course, you can do simple cases with $push and a query, but that&apos;s always true for $addToSet and stops working when combined with other changes.)&lt;/p&gt;

&lt;p&gt;I don&apos;t currently need sorting, that was just copied in by the clone.&lt;/p&gt;</comment>
                            <comment id="490478" author="glenn" created="Wed, 29 Jan 2014 22:18:27 +0000"  >&lt;p&gt;(This is a clone of &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-8512&quot; title=&quot;support $slice/sort in $addToSet&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-8512&quot;&gt;&lt;del&gt;SERVER-8512&lt;/del&gt;&lt;/a&gt;.  I&apos;d reopen that ticket, but the system won&apos;t let me, and if I just comment on a closed ticket it&apos;ll probably be lost in the noise.)&lt;/p&gt;

&lt;p&gt;The rationale for closing &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-8512&quot; title=&quot;support $slice/sort in $addToSet&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-8512&quot;&gt;&lt;del&gt;SERVER-8512&lt;/del&gt;&lt;/a&gt; is incorrect.  addToSet isn&apos;t a set operation, despite its name; it&apos;s an array operation.  Code depends on it adding to the end and preserving order.  If you want to add unordered set operations in the future, then that would be a different command than addToSet.&lt;/p&gt;

&lt;p&gt;addToSet should support $slice, to allow adding to a list without allowing duplicates and limiting the total size of the list in the same operation.  (Alternatively, to get the same effect, add an &quot;ignoreDuplicates&quot; boolean flag to $push and $pushAll to make it behave like addToSet, so its $slice modifier can be used.)&lt;/p&gt;
</comment>
                            <comment id="490476" author="scotthernandez" created="Wed, 29 Jan 2014 22:17:49 +0000"  >&lt;p&gt;I believe this idea has been rejected for sets, but I pushed the idea before that arrays and set should have the same functionality in update. &lt;/p&gt;

&lt;p&gt;Do you have a use-case where you want to sort/slice with a set?&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>5.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                <customfield id="customfield_12751" key="com.atlassian.jira.plugin.system.customfieldtypes:multiselect">
                        <customfieldname>Assigned Teams</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="25143"><![CDATA[Query]]></customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Wed, 29 Jan 2014 22:17:49 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        4 years, 32 weeks, 4 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_10857" key="com.pyxis.greenhopper.jira:gh-epic-link">
                        <customfieldname>Epic Link</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>PM-1021</customfieldvalue>
                        </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>alexander.golin@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            4 years, 32 weeks, 4 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>asya.kamsky@mongodb.com</customfieldvalue>
            <customfieldvalue>backlog-server-query</customfieldvalue>
            <customfieldvalue>glenn</customfieldvalue>
            <customfieldvalue>rshumate@flexgen.com</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|hrm2nj:</customfieldvalue>

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

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

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