![](/img/trans.png)
[英]Mongodb checking exist field in an sub-document of an array using mongoose
[英]Insert a new object into a sub-document array field in mongoose
[{
"_id" : ObjectId("579de5ad16944ccc24d5f4f1"),
"dots" :
[
{
"id" : 1,
"location" :
[
{
"lx" : 10,
"ly" : 10
}
]
},
{
"id" : 2,
"location" : [{}]
}
]
}]
以上是模型的 json 格式(来自 mongobooter)让我们说“行”,我有 _id 和 dots.id,我想将新对象添加到位置。 那我该怎么做(使用猫鼬)?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.