summaryrefslogtreecommitdiff
path: root/jstests/geo_multikey1.js
blob: 5c949a8599a7c1f78ab4f44016b9889386c0dc48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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.
t.ensureIndex( {loc:'2d',a:1,b:1,c:1} );
assert( !db.getLastError() );

// Parallel arrays are not allowed for normal indexes.
t.ensureIndex( {loc:1,a:1,b:1,c:1} );
assert( db.getLastError() );