Files
mongo/jstests/core/geo_multikey1.js
2016-03-09 12:18:14 -05:00

19 lines
475 B
JavaScript

// Multikey geo index tests with parallel arrays.
t = db.jstests_geo_multikey1;
t.drop();
locArr = [];
arr = [];
for (i = 0; i < 10; ++i) {
locArr.push([i, i + 1]);
arr.push(i);
}
t.save({loc: locArr, a: arr, b: arr, c: arr});
// Parallel arrays are allowed for geo indexes.
assert.commandWorked(t.ensureIndex({loc: '2d', a: 1, b: 1, c: 1}));
// Parallel arrays are not allowed for normal indexes.
assert.commandFailed(t.ensureIndex({loc: 1, a: 1, b: 1, c: 1}));