summaryrefslogtreecommitdiff
path: root/jstests/core/index/geo/geoa.js
blob: 26bfc10b8cfe38551b923ed7b4d622228ae67b16 (plain)
1
2
3
4
5
6
7
8
9
10
11
let t = db.geoa;
t.drop();

t.save({_id: 1, a: {loc: [5, 5]}});
t.save({_id: 2, a: {loc: [6, 6]}});
t.save({_id: 3, a: {loc: [7, 7]}});

t.createIndex({"a.loc": "2d"});

let cur = t.find({"a.loc": {$near: [6, 6]}});
assert.eq(2, cur.next()._id, "A1");