简体   繁体   中英

How Does Azure Cosmos DB APIs maps in CLI and Azure Portal

I see on Microsoft's docs that when creating a Cosmos DB account from CLI: az cosmos DB create --name --resourcegroup [--kind {GlobalDocumentDB, MongoDB, Parse}]

But when we create a Cosmos DB account from the Portal we get 5 API options: SQL, Mongo DB, Table, Cassandra, Gremlin.

But, how do these 3 kinds from CLI are mapped to these 5 APIs in the Portal? I am new to Cosmos DB so confused. Thanks in advance.

The database API's in Cosmos are driven by a combination of the --kind property as well as values in a string array called --capabilities .

When creating a new SQL or MongoDB API account you use a combination of "GlobalDocumentDB" for SQL and "MongoDB" resepectively.

To create a Gremlin, Cassandra and Table API account, you specify --kind=GlobalDocumentDB and --capabilities=EnableGremlin or --capabilities=EnableCassandra or --capabilities=EnableTable

You can see this in action by looking at the Azure CLI samples for each of the database API's in Cosmos DB here below.

You can also find all these in a single GitHub repo here, Azure Cosmos DB CLI Samples Repo

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM