Here's what my serialized c# object looks like (simplified for the example, of course):
public class SerializedObject
{
public string _id { get; set; }
[BsonDictionaryOptions(DictionaryRepresentation.Document)]
[StoreAs("D")]
public Dictionary<string, Metric> Daily { get; set; }
}
the Metric object:
public class Metric
{
[StoreAs("CT")]
public int Count { get; set; }
}
What I'm trying to do:
var update = Update<SerializedObject>.Inc(x => x.Daily["2"].Count, 1);
The error thrown, a NotSupportedException:
Unable to determine the serialization information for the expression: (SerializedObject x) => x.Daily.get_Item("2").Count.
Is it as the name of the exception says, something not yet implemented in the 10gen's MongoDB C# driver? Is there a way of doing something like this rather than doing a untyped Update on the actual "stringified" name of the field? (which would be:
Update.Inc("D.2.CT", 1);
Thanks.
(SerializedObject x) => x.Daily.get_Item("2")