2017-08-11 56 views
1

我有这个文件

{ 
    "_id" : "8cbc4fdc79d5479c95deaab471d359bb", 
    "category" : "test", 
    "location" : { 
     "name" : "Café Café", 
     "coordinates" : { 
      "type" : "Point", 
      "coordinates" : [ 
       34.788589, 
       32.0857813 
      ] 
     } 
    } 
} 

而这个查询返回0的记录上CosmosDB,而是基于真实的MongoDB

db.activities.find({'location.coordinates': { $near :{$geometry: { type: "Point", coordinates: [ 34.788589, 32.0857813 ] }}}}) 

回答

0

按预期工作我测试,如果我在查询中使用$near,就像你说的那样,它会在Azure Cosmos DB上返回0条记录。 MongoDB的API:

enter image description here

据我所知,并不是所有的MongoDB的查询语法/功能将在Azure的宇宙DB实现。如果可能的话,您可以在Azure Cosmos DB User Voice上打开反馈项目并跟踪更新。

+0

而''geoNear''似乎还不支持。 –