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

NotSupportedException when using Set with sub-documents in an Update with Aggregation Pipeline

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Blocker - P1 Blocker - P1
    • None
    • Affects Version/s: 3.1.0
    • Component/s: None
    • None
    • Dotnet Drivers

      Summary

      We want to reduce the amount of requests that we need to update documents by using updates with an aggregation pipeline. The main stage is a $set stage that sets new values on a sub-document based upon the current values, e.g. increments a value (the real life example is not so simple, it includes a comparison of a timestamp, so using a simple update with an $inc operator is not an option). 

      Please see attached file for examples that raises a NotSupportedException with the reason that the serializers do not match. 

      Please provide the version of the driver. If applicable, please provide the MongoDB server version and topology (standalone, replica set, or sharded cluster).

      Verified the behavior with v3.0 and v3.1.

      How to Reproduce

      See attached sample.

        1. Program.cs
          2 kB
          Markus Wildgruber

            Assignee:
            robert@mongodb.com Robert Stam
            Reporter:
            m.wildgruber@sevantage.de Markus Wildgruber
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: