Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 717
Alex Avatar asked Oct 15 '25 03:10

Alex


2 Answers

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

like image 161
BigDataKid Avatar answered Oct 17 '25 23:10

BigDataKid


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
like image 32
Jared Avatar answered Oct 17 '25 23:10

Jared