summaryrefslogtreecommitdiff
path: root/jstests/multiVersion
diff options
context:
space:
mode:
authorJason Rassi <rassi@10gen.com>2014-02-15 11:40:13 -0500
committerJason Rassi <rassi@10gen.com>2014-02-15 13:56:12 -0500
commitecda90ce4ac91aea66f076aacbbe28f7286a7351 (patch)
tree8ae7880e6f7c19a526c4bea4f187d990db7bb354 /jstests/multiVersion
parentb855e3e54b2cbe9e93ab97866b37beef53d12696 (diff)
downloadmongo-ecda90ce4ac91aea66f076aacbbe28f7286a7351.tar.gz
SERVER-12175 Add 2dsphere index option "2dsphereIndexVersion"
- Defines version 1 and 2; both are supported. - Indexes without this option are assumed to be version 1. - New builds get version 2 (if version unspecified). - Version 1 throws in getKeys if the geometry is one of the types introduced since 2.4.0 (MultiPoint, MultiLineString, MultiPolygon, GeometryCollection).
Diffstat (limited to 'jstests/multiVersion')
-rw-r--r--jstests/multiVersion/libs/data_generators.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/jstests/multiVersion/libs/data_generators.js b/jstests/multiVersion/libs/data_generators.js
index dd7700d74de..610dbd14b8a 100644
--- a/jstests/multiVersion/libs/data_generators.js
+++ b/jstests/multiVersion/libs/data_generators.js
@@ -536,6 +536,15 @@ function IndexDataGenerator(options) {
return attributes;
}
+ function Gen2dSphereIndexOptions(seed) {
+ var attributes = GenIndexOptions(seed);
+ // When using a 2dsphere index, the following additional index properties are required when
+ // downgrading from 2.6:
+ // { "2dsphereIndexVersion" : 1 }
+ attributes["2dsphereIndexVersion"] = 1
+ return attributes;
+ }
+
testIndexes = [
// Single Field Indexes
{ "spec" : GenSingleFieldIndex(1), "options" : GenIndexOptions(0) },
@@ -560,7 +569,7 @@ function IndexDataGenerator(options) {
// Geospatial Indexes
// 2dsphere
- { "spec" : Gen2dsphereIndex(7), "options" : GenIndexOptions(12) },
+ { "spec" : Gen2dsphereIndex(7), "options" : Gen2dSphereIndexOptions(12) },
// 2d
{ "spec" : Gen2dIndex(8), "options" : Gen2dIndexOptions(13) },
// Haystack