Hi,
I am storing objects in my MongoDb, using a CamelCase pack. For example, an object like:
public class Student : MongoObject
{
public string Name { get; set; }
public int Year { get; set; }
}
is stored like:
{
"year : 2000",
"name" : "Philip"
}
Now I want to deserialize the document into a Student object:
var filter = new BsonDocument();
var foundEnt = await collection.Find<T>(filter).FirstOrDefaultAsync();
However, the driver doesn't seem to understand the mapping, and it returns a Student object with null fields.
Deserialization works fine when using the lambda format (which means that the camelcase is correctly registered), however, I need to use the BsonDocument-filter type for my current work.
Is this a bug or I am doing something wrong?