'Does AWS DocumentDB support MongoDB 2dshpere index?

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



Solution 1:[1]

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.

https://cloud.mongodb.com

Solution 2:[2]

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

Solution 3:[3]

Support for 2dsphere indexes was added to Amazon DocumentDB in October 2021.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 BigDataKid
Solution 2 Freddie
Solution 3