summaryrefslogtreecommitdiff
path: root/jstests/core/geo10.js
blob: 45463711406f50f822688011273cb50116b258a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Cannot implicitly shard accessed collections because of extra shard key index in sharded
// collection.
// @tags: [
//   assumes_no_implicit_index_creation,
// ]

// Test for SERVER-2746

coll = db.geo10;
coll.drop();

assert.commandWorked(db.geo10.createIndex({c: '2d', t: 1}, {min: 0, max: Math.pow(2, 40)}));
assert.eq(2, db.geo10.getIndexes().length, "A3");

assert.commandWorked(db.geo10.insert({c: [1, 1], t: 1}));
assert.commandWorked(db.geo10.insert({c: [3600, 3600], t: 1}));
assert.commandWorked(db.geo10.insert({c: [0.001, 0.001], t: 1}));

printjson(
    db.geo10
        .find({
            c: {
                $within:
                    {$box: [[0.001, 0.001], [Math.pow(2, 40) - 0.001, Math.pow(2, 40) - 0.001]]}
            },
            t: 1
        })
        .toArray());