<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Wed Feb 07 21:42:18 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-2349] the driver can&apos;t handle empty field names (which are legal)</title>
                <link>https://jira.mongodb.org/browse/CSHARP-2349</link>
                <project id="10041" key="CSHARP">C# Driver</project>
                    <description>&lt;p&gt;It is possible to create a document with an empty field name. E.g. db.col.insert({&quot;&quot;:&quot;value&quot;})&#160; However, the driver fails with such documents. For example, it does not work with the BulkWrite API:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;var doc = new BsonDocument(&quot;_id&quot;, 0);&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;doc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;&amp;quot;&amp;#93;&lt;/span&gt; = &quot;value&quot;;&lt;/tt&gt;&lt;br/&gt;
&lt;tt&gt;var model = new ReplaceOneModel&amp;lt;BsonDocument&amp;gt;(&lt;/tt&gt;&lt;br/&gt;
{{ new BsonDocumentFilterDefinition&amp;lt;BsonDocument&amp;gt;(new BsonDocument(&quot;_id&quot;, doc&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;quot;_id&amp;quot;&amp;#93;&lt;/span&gt;)), doc);}}&lt;br/&gt;
&lt;tt&gt;collection.BulkWrite(new[] { model });&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;It fails with the following error:&lt;br/&gt;
MongoDB.Bson.BsonSerializationException: Element name &apos;&apos; is not valid&apos;.&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.IO.BsonWriter.WriteName(String name)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.Serializers.BsonDocumentSerializer.SerializeValue(BsonSerializationContext context, BsonSerializationArgs args, BsonDocument value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.Serializers.BsonValueSerializerBase`1.Serialize(BsonSerializationContext context, BsonSerializationArgs args, TBsonValue value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.Serializers.SerializerBase`1.MongoDB.Bson.Serialization.IBsonSerializer.Serialize(BsonSerializationContext context, BsonSerializationArgs args, Object value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Serialize(IBsonSerializer serializer, BsonSerializationContext context, Object value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.Serializers.BsonDocumentWrapperSerializer.SerializeValue(BsonSerializationContext context, BsonSerializationArgs args, BsonDocumentWrapper value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.Serializers.BsonValueSerializerBase`1.Serialize(BsonSerializationContext context, BsonSerializationArgs args, TBsonValue value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.Serializers.SerializerBase`1.MongoDB.Bson.Serialization.IBsonSerializer.Serialize(BsonSerializationContext context, BsonSerializationArgs args, Object value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Serialize(IBsonSerializer serializer, BsonSerializationContext context, Object value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.Serializers.BsonValueSerializerBase`1.Serialize(BsonSerializationContext context, BsonSerializationArgs args, TBsonValue value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Serialize&lt;span class=&quot;error&quot;&gt;&amp;#91;TValue&amp;#93;&lt;/span&gt;(IBsonSerializer`1 serializer, BsonSerializationContext context, TValue value)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Operations.RetryableUpdateCommandOperation.UpdateRequestSerializer.SerializeUpdate(BsonSerializationContext context, BsonSerializationArgs args, UpdateRequest request)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Operations.RetryableUpdateCommandOperation.UpdateRequestSerializer.SerializeValue(BsonSerializationContext context, BsonSerializationArgs args, UpdateRequest value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.Serializers.SealedClassSerializerBase`1.Serialize(BsonSerializationContext context, BsonSerializationArgs args, TValue value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.Serializers.SerializerBase`1.MongoDB.Bson.Serialization.IBsonSerializer.Serialize(BsonSerializationContext context, BsonSerializationArgs args, Object value)&lt;br/&gt;
&#160;&#160; at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Serialize(IBsonSerializer serializer, BsonSerializationContext context, Object value)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders.CommandMessageBinaryEncoder.WriteType1Section(BsonBinaryWriter writer, Type1CommandMessageSection section, Int64 messageStartPosition)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders.CommandMessageBinaryEncoder.WriteSection(BsonBinaryWriter writer, CommandMessageSection section, Int64 messageStartPosition)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders.CommandMessageBinaryEncoder.WriteSections(BsonBinaryWriter writer, IEnumerable`1 sections, Int64 messageStartPosition)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders.CommandMessageBinaryEncoder.WriteMessage(CommandMessage message)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders.CommandRequestMessageBinaryEncoder.WriteMessage(CommandRequestMessage message)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.WireProtocol.Messages.Encoders.BinaryEncoders.CommandRequestMessageBinaryEncoder.MongoDB.Driver.Core.WireProtocol.Messages.Encoders.IMessageEncoder.WriteMessage(MongoDBMessage message)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Connections.BinaryConnection.SendMessagesHelper.EncodeMessages(CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Connections.BinaryConnection.SendMessages(IEnumerable`1 messages, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.PooledConnection.SendMessages(IEnumerable`1 messages, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.ConnectionPools.ExclusiveConnectionPool.AcquiredConnection.SendMessages(IEnumerable`1 messages, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Connections.ConnectionExtensions.SendMessage(IConnection connection, RequestMessage message, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.WireProtocol.CommandUsingCommandMessageWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.WireProtocol.CommandWireProtocol`1.Execute(IConnection connection, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Servers.Server.ServerChannel.ExecuteProtocol&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(IWireProtocol`1 protocol, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Servers.Server.ServerChannel.Command&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(ICoreSession session, ReadPreference readPreference, DatabaseNamespace databaseNamespace, BsonDocument command, IEnumerable`1 commandPayloads, IElementNameValidator commandValidator, BsonDocument additionalOptions, Action`1 postWriteAction, CommandResponseHandling responseHandling, IBsonSerializer`1 resultSerializer, MessageEncoderSettings messageEncoderSettings, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Operations.RetryableWriteCommandOperationBase.ExecuteAttempt(RetryableWriteContext context, Int32 attempt, Nullable`1 transactionNumber, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Operations.RetryableWriteOperationExecutor.Execute&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(IRetryableWriteOperation`1 operation, RetryableWriteContext context, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Operations.BulkUnmixedWriteOperationBase`1.ExecuteBatch(RetryableWriteContext context, Batch batch, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Operations.BulkUnmixedWriteOperationBase`1.ExecuteBatches(RetryableWriteContext context, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Operations.BulkUnmixedWriteOperationBase`1.Execute(RetryableWriteContext context, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Operations.BulkMixedWriteOperation.ExecuteBatch(RetryableWriteContext context, Batch batch, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.Core.Operations.BulkMixedWriteOperation.Execute(IWriteBinding binding, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.OperationExecutor.ExecuteWriteOperation&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(IWriteBinding binding, IWriteOperation`1 operation, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.MongoCollectionImpl`1.ExecuteWriteOperation&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(IClientSessionHandle session, IWriteOperation`1 operation, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.MongoCollectionImpl`1.BulkWrite(IClientSessionHandle session, IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.MongoCollectionImpl`1.&amp;lt;&amp;gt;c_&lt;em&gt;DisplayClass23_0.&amp;lt;BulkWrite&amp;gt;b&lt;/em&gt;_0(IClientSessionHandle session)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.MongoCollectionImpl`1.UsingImplicitSession&lt;span class=&quot;error&quot;&gt;&amp;#91;TResult&amp;#93;&lt;/span&gt;(Func`2 func, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at MongoDB.Driver.MongoCollectionImpl`1.BulkWrite(IEnumerable`1 requests, BulkWriteOptions options, CancellationToken cancellationToken)&lt;br/&gt;
&#160;&#160; at UserQuery.RunUserAuthoredQuery() in c:\Users\admilazz\AppData\Local\Temp\LINQPad&amp;#95;qtpgpfoi\query_xvftyy.cs:line 57&lt;/p&gt;</description>
                <environment>All</environment>
        <key id="583834">CSHARP-2349</key>
            <summary>the driver can&apos;t handle empty field names (which are legal)</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.mongodb.org/images/icons/priorities/minor.svg">Minor - P4</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>Sun, 5 Aug 2018 04:37:24 +0000</created>
                <updated>Thu, 31 Mar 2022 00:52:10 +0000</updated>
                                            <version>2.7.0</version>
                                                    <component>BSON</component>
                                        <votes>1</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="1967188" author="admilazz" created="Sun, 5 Aug 2018 18:46:37 +0000"  >&lt;p&gt;Created pull request:&#160;&lt;a href=&quot;https://github.com/mongodb/mongo-csharp-driver/pull/334&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo-csharp-driver/pull/334&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="1967183" author="admilazz" created="Sun, 5 Aug 2018 18:06:37 +0000"  >&lt;p&gt;I saw this code in CollectionElementNameValidator.cs:&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;if (elementName.Length == 0)&lt;/tt&gt;&lt;br/&gt;
 {&lt;br/&gt;
 &#160; // the server seems to allow empty element names, but in 1.x we did not&lt;br/&gt;
 &#160; return false;&lt;br/&gt;
 &lt;tt&gt;}&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;I don&apos;t know if 1.x refers to MongoDB 1.x or driver version 1.x, but I&apos;ll note that 1.x was a long time ago and MongoDB still supports empty element names, so I think it should be considered a feature of MongoDB by now.&lt;/p&gt;</comment>
                            <comment id="1967175" author="admilazz" created="Sun, 5 Aug 2018 17:38:29 +0000"  >&lt;p&gt;Since the exception is thrown from&#160;&lt;font color=&quot;#333333&quot;&gt;BsonWriter.WriteName&lt;/font&gt;(), the Bson component should probably be added. However, if the bug exists there, it may exist in other places as well, so I believe a survey of the code should be done to find other places that use the same validation logic.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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|htvctj:</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>