Files
mongo/jstests/core/geo_poly_line.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

18 lines
416 B
JavaScript

// Test that weird polygons work SERVER-3725
t = db.geo_polygon5;
t.drop();
t.insert({loc:[0,0]})
t.insert({loc:[1,0]})
t.insert({loc:[2,0]})
t.insert({loc:[3,0]})
t.insert({loc:[4,0]})
t.ensureIndex( { loc : "2d" } );
printjson( t.find({ loc: { "$within": { "$polygon" : [[0,0], [2,0], [4,0]] } } }).toArray() )
assert.eq( 5, t.find({ loc: { "$within": { "$polygon" : [[0,0], [2,0], [4,0]] } } }).itcount() )