summaryrefslogtreecommitdiff
path: root/jstests/core/geo5.js
blob: 67b00f85b44991686aed440209bf5d5d680f7fff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
t = db.geo5;
t.drop();

t.insert( { p : [ 0,0 ] } )
t.ensureIndex( { p : "2d" } )

res = t.runCommand( "geoNear" , { near : [1,1] } );
assert.eq( 1 , res.results.length , "A1" );

t.insert( { p : [ 1,1 ] } )
t.insert( { p : [ -1,-1 ] } )
res = t.runCommand( "geoNear" , { near : [50,50] } );
assert.eq( 3 , res.results.length , "A2" );

t.insert( { p : [ -1,-1 ] } )
res = t.runCommand( "geoNear" , { near : [50,50] } );
assert.eq( 4 , res.results.length , "A3" );