在MongoDB中查找嵌套对象中的值

时间:2016-02-03 11:08:10

标签: mongodb php-mongodb

我有一个具有以下结构的MongoDB集合:

"speed": {
      "m198": [
        {
          "speed": ["60","150"],
          "channels": {
            "push": {
              "timings": {
                "from": "00:00",
                "to": "23:59",
                "delay": 600
              }
            }
          }
        },
        {
          "speed": [ "50","60"],
          "channels": {
            "push": {
              "timings": {
                "from": "00:00",
                "to": "23:59",
                "delay": 600
              }
            }
          }
        },
        {
          "speed": ["60", "100"],
          "channels": {
            "sms": {
              "timings": {
                "from": "00:00",
                "to": "23:59",
                "delay": 600
              },
              "sendTo": [
                "1234567890"
              ]
            }
          }
        }
      ]
    }

我想查询此文档以获取pushchannels的所有记录。我尝试过使用MongoDB的$in()函数,但未能得到确切的结果。

0 个答案:

没有答案