On a collection, I have an existing 2dsphere index (created while still using MongoDB 2.4.x):
I have some code that adds stuff from foursquare, and this script runs PHP's ensureIndex() to create the 2dsphere index in case it doesn't exist. On the shell, the equivalant is:
However, that generates:
But I am not setting any new options.
However, when I create a 2dsphere index on a different field (loc instead of l):
Then it creates this index:
(Note the extra "2dsphereIndexVersion" : 2).
When I then run the createIndex again, I get (correctly):
It looks like it breaks over the extra 2dsphereIndexVersion "option", but as user I have no influence over that not being set.