I am working with the latest C # driver for MongoDB . Now I know it's beta, but I think I'm doing some basic things.
What is my problem: I'm trying to set the view for my Id field to ObjectId instead of string , as described in the documentation :
BsonClassMap.RegisterClassMap<Entity>(cm => { cm.AutoMap(); cm.IdMemberMap.SetRepresentation(BsonType.ObjectId); });
But I cannot do this because the SetRepresentation() method does not exist. And I canβt find anything like it.
So wondering if this method has been removed? Is there any other way to set a view besides attributes? I cannot use attributes, because I do not have access to the Entity class, I work with a derived class.
Thanks in advance!
source share