【发布时间】:2013-05-01 03:33:09
【问题描述】:
我有一个类似的 JSON 文档
{
"branch": [
{
"section": [
{
"sub": "edc",
"time": "one hour",
"frequency": "3"
},
{
"sub": "bee",
"time": "two hours",
"frequency": "4"
}
]
},
{
"section": [
{
"sub": "ss",
"time": "one hour",
"frequency": "2"
},
{
"sub": "ms",
"time": "two hours",
"frequency": "5"
}
]
}
]
}
现在我想删除
{
"sub": "edc",
"time": "one hour",
"frequency": "3"
}
使用以下集合中的"sub":"edc"
我希望查询在 mongo db 中执行更改
【问题讨论】:
-
branch是包含section文档的集合吗? -
"branch" 不是一个集合。上面的 json 文档在 mongo db 中的集合中说“college”。我想更新可以删除 { "sub": "edc", "time": "one hour", "frequency": "3" } 的数据库