如何从mongoDB查询给定对象的下方

时间:2019-01-14 11:21:40

标签: angular mongodb

我无法从mongoDb查询具有给定ID的环境。你能帮忙吗?

db.scenarios.find({“ scenarios.environment”:103})。我尝试了各种方法。仍然无法正常工作

{
  "description": "All Scenarios",
  "scenarios":[
    {
      "environment": 101,
      "Scenarios": [
            {
                "id": 100101,
                "name": "E2E Inbound Workflow",
                "createdby": "Aarthi",
                "createddatetime": "12.12.2018 12:30:23 EST"
            },
            {
                "id": 100122,
                "name": "E2E Outbound Workflow",
                "createdby": "Aarthi",
                "createddatetime": "12.12.2018 12:30:23 EST"
            }
        ]
    },
    {
      "environment": 102,
      "Scenarios": [
        {
            "id": 100101,
            "name": "E2E Inbound Workflow",
            "createdby": "Aarthi",
            "createddatetime": "12.12.2018 12:30:23 EST"
         },
        {
            "id": 100122,
            "name": "E2E Outbound Workflow",
            "createdby": "Aarthi",
            "createddatetime": "12.12.2018 12:30:23 EST"
         }
        ]
    }
]

}

我想从mongoDb获取包含给定ID的对象。任何人的帮助都会有所帮助

0 个答案:

没有答案