Cannot deserialize a 'Guid' from BsonType 'ObjectId' in azure cosmos documentdb

95132786 2 Reputation points
2024-07-02T08:47:59.98+00:00

I am using Azure mongo db collection and accessing it via dotnet application. I am getting error for some of the documents "Cannot deserialize a 'Guid' from BsonType 'ObjectId'" while retrieving. In dotnet, model class having Id property of type guid and In document db, _id is stored as binary format. Mongo db version which we are using is MongoDB.Driver-"2.27.0". I am trying to access documents via findasync method and filtering using key property. Can you please help me to get out of this issue?

Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,518 questions
{count} votes