Comparing version 0.2.4 to 0.2.5
0.2.4 / 2013-07-30 | ||
================== | ||
* updated docs | ||
* changed internal representation of `sort` to use objects instead of arrays | ||
0.2.4 / 2013-07-25 | ||
@@ -3,0 +9,0 @@ ================== |
@@ -1188,4 +1188,5 @@ 'use strict'; | ||
} | ||
var arr = opts.sort || (opts.sort = []); | ||
arr.push([field, value]); | ||
// store `sort` in a sane format | ||
var s = opts.sort || (opts.sort = {}); | ||
s[field] = value; | ||
} | ||
@@ -1192,0 +1193,0 @@ |
{ | ||
"name": "mquery", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Expressive query building for MongoDB", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -314,3 +314,3 @@ #mquery | ||
query.where('loc').within().circle(area) | ||
query.center('loc', area); | ||
query.circle('loc', area); | ||
@@ -320,3 +320,3 @@ // for spherical calculations | ||
query.where('loc').within().circle(area) | ||
query.center('loc', area); | ||
query.circle('loc', area); | ||
``` | ||
@@ -521,2 +521,21 @@ | ||
###near() | ||
Specifies arguments for a `$near` or `$nearSphere` condition. | ||
These operators return documents sorted by distance. | ||
####Example | ||
```js | ||
query.where('loc').near({ center: [10, 10] }); | ||
query.where('loc').near({ center: [10, 10], maxDistance: 5 }); | ||
query.near('loc', { center: [10, 10], maxDistance: 5 }); | ||
// For a $nearSphere condition, pass the `spherical` option. | ||
query.near({ center: [10, 10], maxDistance: 5, spherical: true }); | ||
``` | ||
[MongoDB Documentation](http://www.mongodb.org/display/DOCS/Geospatial+Indexing) | ||
###or() | ||
@@ -523,0 +542,0 @@ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
172512
4703
958