我想用loc数组长度>对结果进行排序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数组长度>对结果进行排序0
我该怎么做?
我只需要空的地方