【发布时间】:2023-03-05 22:29:02
【问题描述】:
我想从 mongo 中删除特定数据。下面是我的json。我想删除所有出现的 IIT-395。
{
"_id" : "i34908s",
"lifeStageCourses" : [
{
"lifeStage" : "in_school",
"tags" : [
"IIT-182"
],
"courseIds" : []
},
{
"lifeStage" : "in_college",
"tags" : [
"IIT-134",
"IIT-140",
"IIT-395"
],
"courseIds" : []
},
{
"lifeStage" : "prep_entrance_exam",
"tags" : [],
"courseIds" : []
},
{
"lifeStage" : "job_seeker",
"tags" : [
"IIT-134",
"IIT-395"
],
"courseIds" : []
}
]
}
我希望只删除输出 IIT-395
整个文档都被删除了。
【问题讨论】:
标签: php mongodb mongodb-query