使用php连接mongodb,然后利用command函数进行求解用户距离,距离总是出错:
$query = array(
'geoNear'=>"user",
'near'=>array(108.915939,34.242401),
'spherial'=>true,
'maxDistance'=>1, 
'distanceMultiplier'=>6378000,
);
$db= $this->conn->wechat;
$dis = $db->command($query);
return $dis;而我用命令行db.runCommand({geoNear:'user',near:[108.915939,34.242401],spherical:true, dist
ceMultiplier:6378000})这个跑出来的距离时差不多的。求大神解救。。