如何在PHP MONGODB中检索所有嵌入的数组值

时间:2017-05-25 10:35:08

标签: php mongodb

我想在PHP MONGODB中仅检索选择框的所有位置_id字段。我怎样才能做到这一点。 DB结构是:

{
    "_id" : "state1",
    "s_name" : "West Bengal",
    "places" : [
        [
            {
                "_id" : "Howra"
            }
        ],
        [
            {
                "_id" : "Kolkata"
            }
        ],
        [
            {
                "_id" : "Jalpaiguri"
            }
        ],
        [
           {
                "_id" : "Alipurduar"
           }
        ],
    ]
}

我怎么能在这里写PHPcode ...

<select class="form-control input-sm">
    <option></option>
    <option></option>
</select>

enter image description here

0 个答案:

没有答案