-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7481e47
commit f592df4
Showing
1 changed file
with
2 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,5 @@ | ||
# `collection.geoNear` | ||
|
||
[Mongo documentation <i class="fa fa-external-link" style="position: relative; top: 2px;" />](http://mongodb.github.io/node-mongodb-native/2.0/api/Collection.html#geoNear) | ||
[Mongo documentation <i class="fa fa-external-link" style="position: relative; top: 2px;" />](https://docs.mongodb.com/manual/reference/command/geoNear) | ||
|
||
Execute the geoNear command to search for items in the collection. | ||
|
||
#### Arguments | ||
|
||
1. `x` *(number)* - Point to search on the x axis, ensure the indexes are ordered in the same order. | ||
|
||
1. `y` *(number)* - Point to search on the y axis, ensure the indexes are ordered in the same order. | ||
|
||
1. [`options`] *(Object)* | ||
|
||
1. [`callback`] *(function)* | ||
|
||
#### Returns | ||
|
||
A promise. | ||
|
||
#### Example | ||
|
||
```js | ||
users.geoNear(50, 50, {query:{a:1}, num:1}).then((results) => {}) | ||
``` | ||
Node.js MongDB native driver 3.x [removes the support of this command](https://github.com/mongodb/node-mongodb-native/blob/master/CHANGES_3.0.0.md), since there are already alternatives like `$near` and `$nearSphere` query operators (see the documentation link above for more info). |