Files
mongo/jstests/core/geo5.js
Randolph Tan 5595b94560 SERVER-12127 migrate js tests to jscore suite when not related to writes
Moved test jstest/[a-i].js -> jstests/core/ and made changes to comply with write command api
2014-02-28 16:26:33 -05:00

19 lines
466 B
JavaScript

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" );