summaryrefslogtreecommitdiff
path: root/src/mongo/db/geo/s2cursor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/geo/s2cursor.cpp')
-rw-r--r--src/mongo/db/geo/s2cursor.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/geo/s2cursor.cpp b/src/mongo/db/geo/s2cursor.cpp
index 56bb9230ce2..a0e07f56d8e 100644
--- a/src/mongo/db/geo/s2cursor.cpp
+++ b/src/mongo/db/geo/s2cursor.cpp
@@ -49,7 +49,13 @@ namespace mongo {
BSONObjIterator i(_keyPattern);
while (i.more()) {
BSONElement e = i.next();
- specBuilder.append(e.fieldName(), 1);
+ // Checked in AccessMethod already, so we know this spec has only numbers and 2dsphere
+ if ( e.type() == String ) {
+ specBuilder.append( e.fieldName(), 1 );
+ }
+ else {
+ specBuilder.append( e.fieldName(), e.numberInt() );
+ }
}
BSONObj spec = specBuilder.obj();
IndexSpec specForFRV(spec);