Reputation: 91
i'm trying run existing application with a new AWS DocumentDB service. From mongo shell i tried to run
db.geojson.createIndex( { geoData : "2dsphere" , sessionId:1 } )
and received
{ "ok" : 0, "errmsg" : "Index type not supported : 2dsphere", "code" : 303 }
this code works well with actual MongoDb instance, but not with new AWS service, which supposed to be compatible with MongoDB 3.6
Upvotes: 4
Views: 2457
Reputation: 1302
Support for 2dsphere indexes was added to Amazon DocumentDB in October 2021.
Upvotes: 0
Reputation: 1075
These are the indexes supported by DocumentDB at the time of this posting:
Single Field Index - Yes
Compound Index - Yes
Multikey Index - Yes
Text Index - No
2dsphere - No
2d Index - No
Hashed Index - No
Upvotes: 1
Reputation: 1227
No. AWS DocumentDB does not support geospatial index or queries. There are several index limitations detailed here: https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis-index.html
In order to use 2dsphere index you can use MongoDB Atlas on AWS and have access to the full set of MongoDB API and features.
Upvotes: 5