summaryrefslogtreecommitdiff
path: root/jstests/core/geo_distinct.js
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2014-07-30 19:04:52 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2014-08-06 14:09:00 -0400
commit0909916a337366eb316386ced7ee6c2ade86a89c (patch)
treea2abd4f129549f27976a516c4c96df4daf399fdc /jstests/core/geo_distinct.js
parent5aa26641648876ee10dcfc8ff7256dd46efc8b9c (diff)
downloadmongo-0909916a337366eb316386ced7ee6c2ade86a89c.tar.gz
SERVER-14515 Remove default limit from geoNear operations
Diffstat (limited to 'jstests/core/geo_distinct.js')
-rw-r--r--jstests/core/geo_distinct.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/jstests/core/geo_distinct.js b/jstests/core/geo_distinct.js
index bb2fd5bf85b..eccb517ed83 100644
--- a/jstests/core/geo_distinct.js
+++ b/jstests/core/geo_distinct.js
@@ -84,23 +84,23 @@ res = coll.runCommand( 'distinct', { key: 'zone',
assert.commandWorked( res );
assert.eq( res.values.sort(), [ 3 ] );
-// Test distinct with $near query predicate (recall that $near returns the closest 100 points).
+// Test distinct with $near query predicate.
coll.dropIndexes();
// A. Unindexed key, no geo index on query predicate.
res = coll.runCommand( 'distinct', { key: 'zone',
- query: { 'loc.coordinates': { $near: [ 0, 0 ] } } } );
+ query: { 'loc.coordinates': { $near: [ 0, 0 ], $maxDistance: 1 } } } );
assert.commandFailed( res );
// B. Unindexed key, with 2d index on query predicate.
assert.commandWorked( coll.ensureIndex( { 'loc.coordinates': '2d' } ) );
res = coll.runCommand( 'distinct', { key: 'zone',
- query: { 'loc.coordinates': { $near: [ 0, 0 ] } } } );
+ query: { 'loc.coordinates': { $near: [ 0, 0 ], $maxDistance: 1 } } } );
assert.commandWorked( res );
-assert.eq( res.values.sort(), [ 2, 3, 4 ] );
+assert.eq( res.values.sort(), [ 3 ] );
// C. Indexed key, with 2d index on query predicate.
assert.commandWorked( coll.ensureIndex( { zone: 1 } ) );
res = coll.runCommand( 'distinct', { key: 'zone',
- query: { 'loc.coordinates': { $near: [ 0, 0 ] } } } );
+ query: { 'loc.coordinates': { $near: [ 0, 0 ], $maxDistance: 1 } } } );
assert.commandWorked( res );
-assert.eq( res.values.sort(), [ 2, 3, 4 ] );
+assert.eq( res.values.sort(), [ 3 ] );