3

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

kevinadi
  • 13,365
  • 3
  • 33
  • 49
Alex
  • 81
  • 1
  • 5
  • 3
    Right after posting was able to find an answer, AWS DocumentDB has quite poor index support, no 2dsphere or text index https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis-index.html – Alex Feb 17 '19 at 16:34
  • Can you fix the typo in "2dsphere" for the sake of indexing and search please? – Fabien Haddadi Oct 18 '22 at 13:27

3 Answers3

4

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

BigDataKid
  • 1,199
  • 6
  • 10
1

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
Freddie
  • 908
  • 1
  • 12
  • 24
0

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

tmcallaghan
  • 1,292
  • 2
  • 10
  • 20