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

Find fails when a result document has duplicate element names

    • Type: Icon: New Feature New Feature
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.7.0
    • Component/s: Read Operations
    • None
    • Environment:
      All
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      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);

            Assignee:
            Unassigned Unassigned
            Reporter:
            admilazz Adam Milazzo
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: