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

Oplog tail BsonDocument deserialization

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 1.10.1
    • None

    Description

      We are running into an interesting issue. We are tailing the Mongo oplog and thought that BsonDocument would just be a catch all. But, it turns out that another product in our company has started using the same Mongo instance and they have set their C# driver to use the standard UUID format. It looks like BsonDocument is trying to deserialize the BinData using our C# settings. We get the following:

      The GuidRepresentation for the reader is CSharpLegacy, which requires the binary sub type to be UuidLegacy, not UuidStandard.

      MongoDB.Bson.IO.BsonBinaryReader.ReadBinaryData()
      at MongoDB.Bson.Serialization.Serializers.BsonBinaryDataSerializer.Deserialize(BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonBaseSerializer.Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonValueSerializer.Deserialize(BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonBaseSerializer.Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonDocumentSerializer.Deserialize(BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonBaseSerializer.Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonValueSerializer.Deserialize(BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonBaseSerializer.Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonDocumentSerializer.Deserialize(BsonReader bsonReader, Type nominalType, Type actualType, IBsonSerializationOptions options)
      at MongoDB.Bson.Serialization.Serializers.BsonBaseSerializer.Deserialize(BsonReader bsonReader, Type nominalType, IBsonSerializationOptions options)
      at MongoDB.Driver.Internal.MongoReplyMessage`1.ReadBodyFrom(BsonBuffer buffer)
      at MongoDB.Driver.Internal.MongoConnection.ReceiveMessage[TDocument](BsonBinaryReaderSettings readerSettings, IBsonSerializer serializer, IBsonSerializationOptions serializationOptions)
      at MongoDB.Driver.MongoCursorEnumerator`1.GetReply(MongoConnection connection, MongoRequestMessage message)
      at MongoDB.Driver.MongoCursorEnumerator`1.GetFirst()
      at MongoDB.Driver.MongoCursorEnumerator`1.MoveNext()

      Is there a way to have BsonDocument just give us what's in the database without having to deserialize anything or to just ignore uuid setting?

      Attachments

        Activity

          People

            Unassigned Unassigned
            cdrobison@xactware.com Chris Robison
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: