<mongodb geonear array length> 0

时间:2015-04-22 20:38:33

标签: php mongodb

我想用loc数组长度&gt;对结果进行排序0

$cursor = $this->mongodb->command(array(
           'geoNear' => "place",        
           'near' => $lonlat,             
           'spherical' => true,            
           'num' => 20,    
           'query' => array("loc->0" => array("$exists" => true))
       ));

   [0] => Array
        (
            [loc] => Array
                (
                    [type] => Point
                    [coordinates] => Array
                        (
                            [0] => 32.929092407227
                            [1] => 39.960571289062
                        )

                )

        )

    [1] => Array
        (
            [loc] => Array
                (
                )

        )

我想用loc数组长度&gt;对结果进行排序0

我该怎么做?

我只需要空的地方

0 个答案:

没有答案