-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 2.9.1
-
Component/s: Serialization
-
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.