             try container.encode(value)
         case .text:
             let value = "text"
+            try container.encode(value)
+        case .sphere2d:
+            let value = "2dsphere"
             try container.encode(value)
         }
     }

            switch try container.decode(_IndexTypeNames.self) {
            case .text:
                self = .text
            }
        }
    }
    
    case ascending, descending
    case text
    
    /// Internal helper that translates the index type to a primitive
    var primitive: Primitive {

    /// Used by indexType for type-safety
    private enum _IndexTypeNames: String, Codable {
        case text
        case sphere2d
    }
    
    /// Used by indexType for type-safety
