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

ChangeStreamOperationTypeSerializer doesn't handle dropDatabase

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: 2.15.0
    • Component/s: Serialization
    • None

      Summary

      When monitoring a change stream, an event of dropDatabase is not handled by the serializer and causes an exception if you attempt to access ChangeStreamDocument.OperationType.

       

      System.FormatException: Invalid ChangeStreamOperationType: "dropDatabase".
       at MongoDB.Driver.ChangeStreamOperationTypeSerializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
       at MongoDB.Bson.Serialization.Serializers.SerializerBase`1.MongoDB.Bson.Serialization.IBsonSerializer.Deserialize(BsonDeserializationContext context, BsonDeserializationArgs args)
       at MongoDB.Bson.Serialization.IBsonSerializerExtensions.Deserialize(IBsonSerializer serializer, BsonDeserializationContext context)
       at MongoDB.Bson.Serialization.BsonSerializationInfo.DeserializeValue(BsonValue value)
       at MongoDB.Bson.Serialization.BsonDocumentBackedClass.GetValue[T](String memberName, T defaultValue)
       at MongoDB.Driver.ChangeStreamDocument`1.get_OperationType()

       

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

      C# driver version is 2.15.0. Server version is 5.0.6 on a MongoDB Atlas shared cluster.

      How to Reproduce

      Connect to a cluster. Initiate a watch against the IMongoClient object. Drop a database in the cluster.

            Assignee:
            boris.dogadov@mongodb.com Boris Dogadov
            Reporter:
            eric_rosenquist@cysiv.com Eric Rosenquist
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: