查找文档,然后在数组中查找条目并将其从数组中删除
Find document, then find entry within array and remove it from the array
在 Node 和 Mongoose 中,我想从文档中的数组中删除一个对象。结构是这样的
{
_id: ObjectId,
title: String,
tags: [
{ text: String },
{ text: String }
]
}
我将按 _id
查找项目,但随后我想在标签内查找某个 String
并将其从数组中删除。
在 Node 和 Mongoose 中,我想从文档中的数组中删除一个对象。结构是这样的
{
_id: ObjectId,
title: String,
tags: [
{ text: String },
{ text: String }
]
}
我将按 _id
查找项目,但随后我想在标签内查找某个 String
并将其从数组中删除。