我有以下MongoDB文件"标识"具有可变属性。
1 -
"identifications" : {
"a" : {
"type" : "a",
"value" : "x1"
}
}
2 -
"identifications" : {
"a" : {
"type" : "a",
"value" : "x2"
}
}
3 -
"identifications" : {
"b" : {
"type" : "b",
"value" : "x3"
}
}
4 -
"identifications" : {
"c" : {
"type" : "c",
"value" : "x4"
}
}
我想在BSONType中为C#Driver序列化标识文档。我的想法是
public class Identifications
{
[BsonElement(Order = 1)]
public Property prop { get; set; }
}
但它返回一个空值。无论其名称如何,都有一些东西需要它?