您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

Azure Cosmos DB:REST API 参考Azure Cosmos DB: REST API Reference

Azure Cosmos DB 是一种全球分布的多模型数据库,它支持文档、图形和键-值数据模型。Azure Cosmos DB is a globally distributed multi-model database that supports the document, graph, and key-value data models. 本部分中的内容适用于通过 REST 使用 SQL API 创建、查询和管理文档资源。The content in this section is for creating, querying, and managing document resources using the SQL API via REST.

Azure Cosmos DB REST API 提供对 Azure Cosmos DB 资源的编程访问,以便创建、查询和删除数据库、文档集和文档。The Azure Cosmos DB REST API provides programmatic access to Azure Cosmos DB resources to create, query, and delete databases, document collections, and documents. 若要对 Azure Cosmos DB 资源执行操作,请使用支持的方法 GET (、、或)将 HTTPS 请求发送 POST PUT DELETE 到面向资源集合或特定资源的终结点。To perform operations on Azure Cosmos DB resources, you send HTTPS requests with a supported method: GET, POST, PUT, or DELETE to an endpoint that targets a resource collection or a specific resource. 本部分说明如何使用 REST API 处理资源。This section explains how to work with resources by using the REST API.

以下视频介绍了 Azure Cosmos DB REST Api。The follow video gives a great introduction to Azure Cosmos DB REST APIs.

支持的 REST API 版本Supported REST API Versions

下表列出了 Azure Cosmos DB 服务支持的 REST API 版本。The following table lists the supported REST API versions by the Azure Cosmos DB service. 必须通过 x-ms-version 每个请求中的标头指定版本。The version must be specified via the x-ms-version header in every request. 如果未指定,则服务默认为最新版本 2017-02-22If not specified, the service defaults to the latest version 2017-02-22.

VersionVersion 引入的更改Change introduced 停用日期Retirement date
2018-12-312018-12-31 已分区集合自动迁移Partitioned collections automatic migration
2018-09-172018-09-17 复合和额外的空间索引Composite and additional spatial indexing
2018-08-312018-08-31 动态集合缩放改进Dynamic collection scaling improvements
2018-06-182018-06-18 多区域写入支持Multi-region write support
2017-11-152017-11-15 多区域强一致性Multi-region Strong Consistency
2017-05-032017-05-03 大分区键Large partition key
2017-02-222017-02-22 一致前缀Consistent prefix
2017-01-192017-01-19 将分区集合的最小吞吐量降低到 2500 RU/秒Lowered minimum throughput for partitioned collections to 2500 RU/s
2016-07-112016-07-11 更改源Change feed
2015-12-162015-12-16 分区集合Partitioned collections
2015-08-062015-08-06 UpsertUpsert
2015-06-032015-06-03 按支持排序Order By support
2015-04-082015-04-08 DocumentDB 常规可用性 (现在 Azure Cosmos DB 的一部分) DocumentDB general availability (now part of Azure Cosmos DB)
2014-08-212014-08-21 DocumentDB 公共预览版 (现在 Azure Cosmos DB 的一部分) DocumentDB public preview (now part of Azure Cosmos DB) 2016年2月29日February 29th, 2016

Cosmos DB 资源Cosmos DB Resources

以下文章介绍了每种资源类型支持的 REST Api。The following articles describe the supported REST APIs for each resource type. 有关资源模型的常规信息,请参阅 资源模型Cosmos DB 资源 uriFor general information about the resource model, see Resource model and Cosmos DB resource URIs.

有关如何授权请求的详细说明,请参阅 访问控制See Access control for how to authorize requests. 有关请求和响应选项的常规信息,请参阅以下文章:For general information about request and response options, see the following articles:

另请参阅See Also