AZ520691 - Generally Available: ORDER BY ST_DISTANCE in Azure Cosmos DB for NoSQL Geospatial Queries

Azure Updates

Discussionpowered by zap.ms

Published

Nov 5, 2025

Status

Launched

Timeline

  • November 2025
    General Availability

Product

Azure Cosmos DB

Tag

Features

Category

Databases
Internet of Things

Description

Azure Cosmos DB for NoSQL now supports ORDER BY ST_DISTANCE for geospatial queries, now generally available. 


With this feature, you can sort query results by their distance from a given point or GeoJSON object directly within Azure Cosmos DB. You no longer need to calculate distances in application code or perform client-side sorting. This function makes it easier to deliver real-time, location-aware experiences for logistics, retail, mapping, and smart-city scenarios with less code and better performance, such as “find the nearest store,” “list drivers by proximity,” or “rank properties by distance.” 


By handling sorting within the database engine, queries become simpler, faster, and more efficient, reducing latency and round-trip overhead. ORDER BY ST_DISTANCE works seamlessly with existing spatial data types and indexing in Azure Cosmos DB, providing consistent performance and accuracy at global scale.