在嵌套文档中插入文档并且嵌套不固定

时间:2019-05-02 13:25:00

标签: mongodb aggregation-framework

我想在附加的JSON中插入文档。嵌套中就没有文档。

{
  "_id": "5ccae8b9a903f7e944362eda",
  "name": "Project",
  "description": "New Project",
  "item": [
    {
      "name": "Folder_2",
      "_id": "5ccae8b9a903f7e944362edb",
      "description": "Desc_3",
      "isSubFolder": true,
      "item": [
        {
          "name": "Folder_3",
          "description": "Desc_3",
          "isSubFolder": true,
          "item": [
            {
              "name": "Folder_4",
              "description": "Desc_4",
              "isSubFolder": true,
              "item": [
                {
                  "name": "Folder_5",
                  "description": "Desc_5",
                  "item": [
                    {
                      "name": "Folder_6",
                      "item": [],
                      "description": "Desc_6",
                      "isSubFolder": true
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

0 个答案:

没有答案