![](/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.