<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:39:16 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-1320] Empty _id using ReplaceOneAsync</title>
                <link>https://jira.mongodb.org/browse/CSHARP-1320</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;Hi, &lt;br/&gt;
running that code :&lt;/p&gt;

&lt;p&gt;await this.Collection.ReplaceOneAsync(x =&amp;gt; x.Name == city.Name  x.CountryCode == city.CountryCode, newObject, new UpdateOptions() &lt;/p&gt;
{ IsUpsert = true }
&lt;p&gt;);&lt;/p&gt;

&lt;p&gt;if the object doesn&apos;t exist it create the new one but with an empty id.&lt;br/&gt;
Here what is stored&lt;/p&gt;

&lt;p&gt;/* 1 */&lt;/p&gt;
{
    &quot;_id&quot; : ObjectId(&quot;000000000000000000000000&quot;),
    &quot;CreateAt&quot; : [ 
        NumberLong(635700317931446025), 
        0
    ],
    &quot;UpdateAt&quot; : [ 
        NumberLong(635700317931446025), 
        0
    ],
    &quot;Name&quot; : &quot;My value&quot;,
    &quot;CountryCode&quot; : &quot;it&quot;,
    &quot;Culture&quot; : &quot;en-US&quot;
}</description>
                <environment></environment>
        <key id="210866">CSHARP-1320</key>
            <summary>Empty _id using ReplaceOneAsync</summary>
                <type id="3" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14718&amp;avatarType=issuetype">Task</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="9">Done</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="imperugo">Ugo Lattanzi</reporter>
                        <labels>
                            <label>question</label>
                    </labels>
                <created>Tue, 16 Jun 2015 06:17:43 +0000</created>
                <updated>Fri, 5 Apr 2019 13:59:02 +0000</updated>
                            <resolved>Wed, 27 Jan 2016 15:17:33 +0000</resolved>
                                    <version>2.0</version>
                                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="942070" author="craiggwilson" created="Tue, 16 Jun 2015 18:11:32 +0000"  >&lt;p&gt;Hi Ugo,&lt;/p&gt;

&lt;p&gt;ObjectId is a value type (struct) and, as such, has a default value that is not null. Because of this, if you don&apos;t specify one, it gets pushed like that. ReplaceOneAsync is generally used when you know the _id of the object you are updating. In your case, that isn&apos;t true. The best thing to do will be to use the BsonIgnoreIfDefaultAttribute on the id property. This will prevent the id from getting written when it&apos;s null.&lt;/p&gt;

&lt;p&gt;Craig&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|hsacj3:</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>