<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:42:25 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-2389] Find fails when a result document has duplicate element names</title>
                <link>https://jira.mongodb.org/browse/CSHARP-2389</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;CursorBatchDeserializationHelper.DeserializeBatch creates a deserialization context that does not support documents with duplicate element names. This prevents the Find() method from being used to query collections with such documents. A fix is to change this line:&lt;/p&gt;

&lt;p&gt;var context = BsonDeserializationContext.CreateRoot(reader);&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;to this line:&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;var context = BsonDeserializationContext.CreateRoot(reader, b =&amp;gt; b.AllowDuplicateElementNames = true);&lt;/p&gt;</description>
                <environment>All</environment>
        <key id="606212">CSHARP-2389</key>
            <summary>Find fails when a result document has duplicate element names</summary>
                <type id="2" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14711&amp;avatarType=issuetype">New Feature</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="10038" iconUrl="https://jira.mongodb.org/images/icons/subtask.gif" description="">Backlog</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="admilazz">Adam Milazzo</reporter>
                        <labels>
                    </labels>
                <created>Mon, 17 Sep 2018 22:02:29 +0000</created>
                <updated>Thu, 31 Mar 2022 00:20:44 +0000</updated>
                                            <version>2.7.0</version>
                                                    <component>Read Operations</component>
                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="2027772" author="rstam" created="Tue, 9 Oct 2018 14:40:27 +0000"  >&lt;p&gt;Agreed that you can create BsonDocuments with duplicate element names by setting AllowDuplicateElementNames to true. Even so it is still not recommended. The behavior of documents with duplicate element names is not well defined in general.&lt;/p&gt;

&lt;p&gt;Your use case of a general purpose tool being able to read any and all existing documents (even if they somehow ended up with duplicate element names) sounds valid.&lt;/p&gt;

&lt;p&gt;We will look into how to support this. It&apos;s not clear that it should be the default.&lt;/p&gt;</comment>
                            <comment id="2027043" author="admilazz" created="Mon, 8 Oct 2018 19:45:56 +0000"  >&lt;p&gt;They can be created by the C# driver. You just set &lt;font color=&quot;#172b4d&quot;&gt;AllowDuplicateElementNames &lt;/font&gt;to true.&lt;/p&gt;

&lt;p&gt;The C# driver should be able to query any MongoDB server, not just servers whose contents were inserted by the C# driver with the default settings.&lt;/p&gt;

&lt;p&gt;I find it useful because I&apos;m working on a tool that can connect to any MongoDB server, and it shouldn&apos;t fail if a server happens to have documents with duplicate element names, which are supported even if not recommended.&lt;/p&gt;</comment>
                            <comment id="2027022" author="rstam" created="Mon, 8 Oct 2018 19:31:20 +0000"  >&lt;p&gt;Documents with duplicate element names are not recommended, and in fact can&apos;t normally be created using the C# driver in the first place.&lt;/p&gt;

&lt;p&gt;Can you elaborate on how you ended up with a document that has duplicate element names and why you would find that useful?&lt;/p&gt;</comment>
                            <comment id="2005747" author="admilazz" created="Mon, 17 Sep 2018 22:04:29 +0000"  >&lt;p&gt;There are many other places where deserialization contexts are created, and many of them may also cause problems. It&apos;s unclear which of them should enable this option, but I believe that they should be enabling that option unless there&apos;s a good reason not to.&lt;/p&gt;

&lt;p&gt;Some other relatively obvious places: ChangeStreamCursor.cs and ParallelScanOperation.cs&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="196452" name="CSHARP-2389.url" size="69" author="admilazz" created="Mon, 17 Sep 2018 22:10:30 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Backwards Compatibility</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10038"><![CDATA[Fully Compatible]]></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_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|htyozz:</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>