You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
what you did at last?
in fact, that's offset caution the error, but I don't know what to do , I'm new in mongodb;
when the offset is smaller than 10 , that's good;
here i have the same error, when set limit(10,$offset); $query is request from url;
it stoped and return an empty array,
the code is :
hello, when i use limit() method query ,i get return results is not what i want .
public static function queryNearby($longitude, $latitude, $maxdistance, $pageSize = 10, $pageNumber = 0)
{
$param = array(
'loc' => array(
'$nearSphere' => array(
'$geometry' => array(
'type' => 'Point',
'coordinates' => array(doubleval($longitude), doubleval($latitude)),
),
'$maxDistance' => $maxdistance //$maxdistance*1000
)
)
);
$columns = ['id','store_name','address','commercial_activities','status','loc','district_no'];
$cursor = Stores::query()->where($param)->columns($columns)->limit((int)$pageSize,(int)($pageNumber))->get();
$result = $cursor->toArray();
return $result;
}
The text was updated successfully, but these errors were encountered: