如何在许多情况下更新深层文档

时间:2019-03-28 03:57:30

标签: arrays mongodb express mongodb-query mongojs

这是我的收藏集。

AuthToken

我想更新为id = 5721602287和note_type.noteid = 1和note_type.noteid.list.id = 1中的键“详细信息”

我尝试在我的Expressjs服务器中使用此命令执行。

{
"_id": {
    "$oid": "5c977ed7fb6fc0465d4b716e"
},
"id": "5721602287",
"note_type": [
    {
        "noteid": 1,
        "name": "music",
        "list": [
            {
                "id": 1,
                "detail": "Somelinks",
                "priority": 10
            },
            {
                "id": 2,
                "detail": "Somelinks",
                "priority": 2
            }
        ]
    },
    {
        "noteid": 2,
        "name": "education",
        "list": [
            {
                "id": 1,
                "detail": "Somelinks",
                "priority": 10
            },
            {
                "id": 2,
                "detail": "Somelinks",
                "priority": 2
            }
        ]
    }]
} 

但出现此错误。

  

(节点:14292)UnhandledPromiseRejectionWarning:MongoError:在路径“ note_type。$。list。$ [j] .detail”中未找到标识符“ j”的数组过滤器

0 个答案:

没有答案