From 0909916a337366eb316386ced7ee6c2ade86a89c Mon Sep 17 00:00:00 2001 From: Siyuan Zhou Date: Wed, 30 Jul 2014 19:04:52 -0400 Subject: SERVER-14515 Remove default limit from geoNear operations --- jstests/core/geo_distinct.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'jstests/core/geo_distinct.js') 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 ] ); -- cgit v1.2.1