summaryrefslogtreecommitdiff
path: root/jstests/geo_poly_line.js
blob: aca77b6ab0a8a28e72bec6be493740d753436382 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// 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() )