Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-2389

Find fails when a result document has duplicate element names

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • 2.7.0
    • Read Operations
    • None
    • All
    • Fully Compatible

    Description

      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:

      var context = BsonDeserializationContext.CreateRoot(reader);

       

      to this line:

       

      var context = BsonDeserializationContext.CreateRoot(reader, b => b.AllowDuplicateElementNames = true);

      Attachments

        Activity

          People

            Unassigned Unassigned
            admilazz Adam Milazzo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: