Reputation: 469
I'm trying to get the closest results (by distance) to a point on documentDB, something similar to $near
in MongoDB.
I tried few variations but keep getting errors/ unsupported messages, and I feel like I might be missing out the appropriate way.
I know that docDB also has a MongoDB API, is it somehow possible to query this API with $near
while I'm using the documentDB API?
Upvotes: 0
Views: 837
Reputation: 27793
It seems that you are using Azure Cosmos DB: DocumentDB API and you’d like to query the closest/nearest results (by distance) to a point. As far as I know, it supports a number of built-in Spatial functions, but currently it does not support nearest.
This thread discussed a similar issue, and as Andrew Liu said, we could select the distance in the query and sort it either client-side or via a stored procedure to get the nearest point.
Besides, someone has gave a feature request, you could vote it.
Upvotes: 0