<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:37:54 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-810] Save with polymorphic _id does not generate the query for the upsert correctly</title>
                <link>https://jira.mongodb.org/browse/CSHARP-810</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;When Save can&apos;t determine for sure that the document is a new document (either because the idGenerator is null or because the id is not empty) it can&apos;t Insert the document so instead it upserts it.&lt;/p&gt;

&lt;p&gt;But if the _id is polymorphic then the _id in the query generated for the Update is slightly wrong (it will be missing the _t field).&lt;/p&gt;

&lt;p&gt;I believe the only way to safely generate the _id value is to serialize the entire document and extract the _id value from the result. The reason for this is because there may be custom serializers involved and we don&apos;t know how exactly they are going to end up representing the _id.&lt;/p&gt;

&lt;p&gt;So Save has to serialize the document into an intermediate BsonDocument and extract the _id from that. It can save some amount of double serialization by then passing the BsonDocument to Update instead of the original document.&lt;/p&gt;</description>
                <environment></environment>
        <key id="87829">CSHARP-810</key>
            <summary>Save with polymorphic _id does not generate the query for the upsert correctly</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="9">Done</resolution>
                                        <assignee username="robert@mongodb.com">Robert Stam</assignee>
                                    <reporter username="robert@mongodb.com">Robert Stam</reporter>
                        <labels>
                    </labels>
                <created>Thu, 29 Aug 2013 02:35:49 +0000</created>
                <updated>Tue, 25 Aug 2015 14:18:08 +0000</updated>
                            <resolved>Mon, 2 Sep 2013 14:22:58 +0000</resolved>
                                    <version>1.8.2</version>
                                    <fixVersion>1.8.3</fixVersion>
                                                        <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="1013853" author="xgen-internal-githook" created="Tue, 25 Aug 2015 14:18:08 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;name&apos;: u&apos;rstam&apos;, u&apos;email&apos;: u&apos;robert@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-810&quot; title=&quot;Save with polymorphic _id does not generate the query for the upsert correctly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-810&quot;&gt;&lt;del&gt;CSHARP-810&lt;/del&gt;&lt;/a&gt;: Save should work with a polymorphic _id (or any custom serialization of an _id).&lt;br/&gt;
Branch: v1.8.x&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/48aae83665d5d9320338613baffb1437450f8654&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/48aae83665d5d9320338613baffb1437450f8654&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="431095" author="auto" created="Wed, 25 Sep 2013 14:56:12 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;rstam&apos;, u&apos;name&apos;: u&apos;rstam&apos;, u&apos;email&apos;: u&apos;robert@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-810&quot; title=&quot;Save with polymorphic _id does not generate the query for the upsert correctly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-810&quot;&gt;&lt;del&gt;CSHARP-810&lt;/del&gt;&lt;/a&gt;: Save should work with a polymorphic _id (or any custom serialization of an _id).&lt;br/&gt;
Branch: v1.8.3&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/48aae83665d5d9320338613baffb1437450f8654&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/48aae83665d5d9320338613baffb1437450f8654&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="416217" author="auto" created="Mon, 2 Sep 2013 14:22:23 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;rstam&apos;, u&apos;name&apos;: u&apos;rstam&apos;, u&apos;email&apos;: u&apos;robert@10gen.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/CSHARP-810&quot; title=&quot;Save with polymorphic _id does not generate the query for the upsert correctly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CSHARP-810&quot;&gt;&lt;del&gt;CSHARP-810&lt;/del&gt;&lt;/a&gt;: Save should work with a polymorphic _id (or any custom serialization of an _id).&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/commit/6af38da4b8271284bc71020df48fb8849af8ec50&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/commit/6af38da4b8271284bc71020df48fb8849af8ec50&lt;/a&gt;&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|hrskdb:</customfieldvalue>

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