推送到对象数组中的数组

时间:2018-10-31 01:43:08

标签: mongodb mongoose subdocument

{
    "_id": {
        "$oid": "5bd8fa85bfbf4e27d86c73eb"
    },
    "status": {
        "iat": 1540947201356,
        "exp": 1540950801358
    },
    "code": "1cmTwKC7",
    "mongoDate": {
        "$date": "2018-10-31T00:41:56.016Z"
    },
    "form": [
        {
            "type": "tf",
            "text": "The first form ever. Welcome...",
            "opts": [],
            "responses": []
        }
    ],
    "updateDate": "October 30th, 2018, 8:47 PM",
    "date": "2019",
    "notes": "notes for this lecture.",
    "name": "TEST",
    "user": {
        "$oid": "5bcfd8a8da59d54024172d5c"
    },
    "course": {
        "$oid": "5bd8fa6cbfbf4e27d86c73ea"
    },
    "__v": 1
}

我有一个以上表格的文件。我想将值推入表单数组中的文档的响应数组中。我不确定如何使用Mongoose for MongoDB来执行此操作,并且还无法找到直接答案。预先感谢。

0 个答案:

没有答案