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

Watch method should work even when documents contain duplicate element names

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.10.3, 2.11.0
    • Affects Version/s: 2.9.1
    • Component/s: Serialization
    • Labels:
      None
    • Fully Compatible

      When calling MoveNext() on an IAsyncCursor<ChangeStreamDocument<T>> where the next change in the oplog is for a document that contains a duplicate element MoveNext() throws an InvalidOperationException with the message, "Duplicate element name '<ElementName>'."

      I can find no way to extract the ID of the document that caused this exception to occur from the change stream and no way to easily find documents with duplicate elements by any other means.

      Obviously you're not meant to have duplicate elements and we certainly try and keep them out of our data but on the odd occasion that it does slip in it is nearly impossible to find and it cripples our use of the change streams because there's no way to get the document ID or skip over the offending document.

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            chris.wyatt@livinglens.tv Jessica Wyatt
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: