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

Watch method should work even when documents contain duplicate element names

    XMLWordPrintable

    Details

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

      Description

      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.

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: