AWS DocumentDB是否支持MongoDB 2dshpere索引?

时间:2019-02-17 16:30:41

标签: aws-documentdb-mongoapi

我正在尝试使用新的AWS DocumentDB服务运行现有应用程序。我试图从mongo shell运行 db.geojson.createIndex( { geoData : "2dsphere" , sessionId:1 } ) 并收到
{ "ok" : 0, "errmsg" : "Index type not supported : 2dsphere", "code" : 303 }

此代码可与实际的MongoDb实例很好地配合,但不适用于新的AWS服务,后者应与MongoDB 3.6兼容

2 个答案:

答案 0 :(得分:1)

不。 AWS DocumentDB不支持地理空间索引或查询。这里有几个索引限制: https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis-index.html

要使用2dsphere索引,您可以在AWS上使用MongoDB Atlas并有权访问MongoDB的全套API和功能。

https://cloud.mongodb.com

答案 1 :(得分:0)

这些是发布时的indexes supported by DocumentDB

Single Field Index - Yes
Compound Index     - Yes
Multikey Index     - Yes
Text Index         - No
2dsphere           - No
2d Index           - No
Hashed Index       - No
相关问题