相关疑难解决方法(0)

更改我的所有文件嵌套文档值

在mongos shell中,我将如何通过并将每个文档更改reviews.category为"类别2"

我的文件结构:

{
   "_id": ObjectId("4fb3f443b1445d24fc000000"),
   "reviews": {
     "0": {
       "category": "category 1"
    },
     "1": {
       "category": "category 1"
    },
     "2": {
       "category": "category 1"
    },
     "3": {
       "category": "category 1"

    } 
  }
}
Run Code Online (Sandbox Code Playgroud)

mongodb

3
推荐指数
1
解决办法
1399
查看次数

标签 统计

mongodb ×1