<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39:15 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>[CSHARP-1313] Combing Inc, silent fail</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1313</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Applying:&lt;br/&gt;
Builders&amp;lt;T&amp;gt;.Update.Inc( &quot;id&quot;,1).Inc(&quot;id&quot;,-1)&lt;br/&gt;
To:&lt;/p&gt;
{id:0}
&lt;p&gt;Result:&lt;/p&gt;
{id:-1}

&lt;p&gt;Combining Inc doesn&apos;t seem to work, it will overwrite the last inc on the same field, this is made more troublesome by the inability to update a collection with a BsonDocument as the update so you can&apos;t get round this.&lt;/p&gt;

&lt;p&gt;There seems to be no error and no way of querying the UpdateDefinition to see if an existing Inc for the field exists.&lt;/p&gt;</description>
                <environment>CSharp, mono and .net</environment>
        <key id="210446">CSHARP-1313</key>
            <summary>Combing Inc, silent fail</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="dwayne@dwaynebull.co.uk">Dwayne Bull</reporter>
                        <labels>
                    </labels>
                <created>Sat, 13 Jun 2015 15:50:17 +0000</created>
                <updated>Sat, 13 Jun 2015 16:15:08 +0000</updated>
                            <resolved>Sat, 13 Jun 2015 16:04:06 +0000</resolved>
                                    <version>2.0.1</version>
                                                    <component>API</component>
                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="939710" author="dwayne@dwaynebull.co.uk" created="Sat, 13 Jun 2015 16:15:08 +0000"  >&lt;p&gt;Fair enough.&lt;br/&gt;
I didn&apos;t realise you could cast a BsonDocument to an UpdateDefinition, that will solve my issue with a bit of work, thanks.&lt;/p&gt;</comment>
                            <comment id="939709" author="craiggwilson" created="Sat, 13 Jun 2015 16:04:06 +0000"  >&lt;p&gt;While there is a remote possibility we could do what you are asking for, I&apos;m going to mark this as won&apos;t fix. It would be surprising for this to happen for current users of this driver as well as other drivers.&lt;/p&gt;

&lt;p&gt;UpdateDefinition is implicitly convertible to a BsonDocument, so you certainly can do what you are asking for. See the documentation here: &lt;a href=&quot;http://mongodb.github.io/mongo-csharp-driver/2.0/reference/driver/definitions/#updates&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://mongodb.github.io/mongo-csharp-driver/2.0/reference/driver/definitions/#updates&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="939708" author="dwayne@dwaynebull.co.uk" created="Sat, 13 Jun 2015 16:00:19 +0000"  >&lt;p&gt;I was hoping for the numeric inc to be taken care of client side, so the resulting combined inc would be passed to the server.&lt;br/&gt;
On another note, it would be good the update methods of IMongoCollection accepted a BsonDocument as well as UpdateDefinition so updates could be done &quot;by hand&quot;&lt;/p&gt;</comment>
                            <comment id="939707" author="craiggwilson" created="Sat, 13 Jun 2015 15:56:36 +0000"  >&lt;p&gt;Hi Dwayne,&lt;/p&gt;

&lt;p&gt;This is not supported in MongoDB. Overwriting or throwing is our only option. We opted for overwriting. Also, realize that this incrementing is taking place server side. We are constructing the update document&lt;/p&gt;
&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;{ $inc: { id: 1 } }&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;
&lt;p&gt;and sending it to the server. Since duplicated fields are not allowed, we simply can&apos;t do what you are wanting.&lt;/p&gt;

&lt;p&gt;Perhaps you could elaborate as to what you need is here and maybe we can figure out another way to handle it.&lt;/p&gt;

&lt;p&gt;Craig&lt;/p&gt;
</comment>
                            <comment id="939706" author="dwayne@dwaynebull.co.uk" created="Sat, 13 Jun 2015 15:51:08 +0000"  >&lt;p&gt;Edit: If would be good if the result was: &lt;/p&gt;
{id:0}</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|hsaalb:</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>