<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 08:59:27 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>[JAVA-3371] The use of UpdateOneModel on MongoCollection#updateOne</title>
                <link>https://jira.mongodb.org/browse/JAVA-3371</link>
                <project id="10006" key="JAVA">Java Driver</project>
                    <description>&lt;p&gt;Hey, I think it&apos;d be cool if we were able to use the UpdateOneModel for MongoCollection#updateOne, I see this being pretty useful especially if you want to update a nested field based on if the document you&apos;re looking for is already there or not, so for one instance you&apos;d use a push but the other you&apos;d use a set one requiring an array filter and the other doesn&apos;t. Due to how it handles array filters if the array filter is unused it&apos;ll throw an exception, I think this would be a good way to avoid this as you can choose whether to have an array filter depending on the update.&lt;/p&gt;</description>
                <environment>N/A</environment>
        <key id="883428">JAVA-3371</key>
            <summary>The use of UpdateOneModel on MongoCollection#updateOne</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="12300">Won&apos;t Do</resolution>
                                        <assignee username="john.stewart@mongodb.com">John Stewart</assignee>
                                    <reporter username="sheacartwright4@gmail.com">Shea Cartwright</reporter>
                        <labels>
                    </labels>
                <created>Sat, 3 Aug 2019 19:28:00 +0000</created>
                <updated>Tue, 6 Aug 2019 18:17:12 +0000</updated>
                            <resolved>Tue, 6 Aug 2019 18:17:12 +0000</resolved>
                                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2360025" author="john.stewart" created="Tue, 6 Aug 2019 18:16:27 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.mongodb.org/secure/ViewProfile.jspa?name=sheacartwright4%40gmail.com&quot; class=&quot;user-hover&quot; rel=&quot;sheacartwright4@gmail.com&quot;&gt;sheacartwright4@gmail.com&lt;/a&gt; Thanks for your update. I will close this ticket. If you find that there is an argument to be made for adding this feature later down the road, please reopen the bug.&lt;/p&gt;</comment>
                            <comment id="2360008" author="sheacartwright4@gmail.com" created="Tue, 6 Aug 2019 18:09:12 +0000"  >&lt;p&gt;It was just something to be slightly more convenient. I currently just use the getters on the UpdateOneModel to do this anyway, I also don&apos;t see many advantages to it now that you ask for some code to demonstrate it. I&apos;ll just continue you to use the getters and passing them through MongoCollection#updateOne.&lt;/p&gt;</comment>
                            <comment id="2358749" author="john.stewart" created="Tue, 6 Aug 2019 01:43:33 +0000"  >&lt;p&gt;The constructors for `UpdateOneModel` have the same parameters as the `MongoCollection#updateOne` parameters, so I do not see the advantage of passing an `UpdateOneModel` object as a parameter to `updateOne`. Could you provide some pseudocode that would illustrate the advantages of using UpdateOneModel in calls to `updateOne`? Thanks.&lt;/p&gt;</comment>
                            <comment id="2356874" author="sheacartwright4@gmail.com" created="Sat, 3 Aug 2019 19:29:47 +0000"  >&lt;p&gt;Sorry didn&apos;t realise I set it to major priority, it&apos;s really not. I also want to say this could also be useful for all the other models which extend WriteModel and their counterpart methods.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hv7sdb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>