2017-08-11 59 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''似乎還不支持。 –