集合结构如下:
求根据提供(参数名称数组)返回对应的内嵌文档{
"_id" : ObjectId("581d8af97dc49b12974f8f65"),
"reco_time" : ISODate("2016-11-04T11:39:45.000+0000"),
"proj_id" : NumberLong(21),
"dev_id" : NumberLong(1091),
"dev_addr" : NumberInt(49),
"frame_seq" : NumberInt(0),
"size" : NumberInt(134),
"machinfo" : {
"参数0" : [
"22",
false
],
"参数1" : [
NumberInt(0),
false
],
"参数2" : [
NumberInt(2),
false
],
"参数3" : [
12.0,
true
],
"参数4" : [
45.0,
true
],}
}
子文档:
"machinfo" : { "参数0" : [ "22", false ], "参数1" : [ NumberInt(0), false ], "参数2" : [ NumberInt(2), false ], "参数3" : [ 12.0, true ], "参数4" : [ 45.0, true ],} }
哪个是“内嵌文档”?
子文档:
"machinfo" : { "参数0" : [ "22", false ], "参数1" : [ NumberInt(0), false ], "参数2" : [ NumberInt(2), false ], "参数3" : [ 12.0, true ], "参数4" : [ 45.0, true ],} }
之前在MongoDB萌阔论坛上看到过关于MongoDB内嵌文档的相关讨论,你可以去看看,希望能帮助到你。
萌阔论坛:http://forum.foxera.com/mongodb/topic/965/mongodb如何统计内嵌子文档的数量?un=Jesse