-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
I'm using the query to organize places by location but return only a few columns/fields from each object in the collection. Based on my understanding of Mongo queries, the raw statement in the code below should work, but it returns an empty array. If I remove the name field it returns all the objects in the collection as expected, but not as desired.
There's several open issues on this question with no relevant responses. Even a "hey idiot, do this" would be nice.
$shops_sorted = Shop::raw(function($collection) use ($latitude, $longitude) {
return $collection->find([
'status' => 'show',
'loc' => [
'$near' => [
$longitude,
$latitude
]
]
],
[
'name' => 1
]
);
})->toArray();
Ishaan-Maheshwari
Metadata
Metadata
Assignees
Labels
No labels