0
我在MongoDB中新蜂,我有收藏中包含键值对.. input collectionMongoDB的枢轴上键值
{"restaurantid" : NumberInt("1"),
"Properties" : [
{ "Key" : "A", "Value" : NumberInt("25") },
{ "Key" : "B", "Value" : "StringValue" },
{ "Key" : "C", "Value" : ISODate("2017-02-09") }
] }
我期待的结果集作为 Output Collection
{ "restaurantid" : NumberInt("1"),
"A" : NumberInt("25"),
"B" : "StringValue",
"C" : ISODate("2017-02-09")
}
如何在聚合管道中不硬编码“A”,“B”,“C”来获取它。我的键值对将变得更大并且对于给定的ID是可变的