共用方式為


CosmosClient.GetDatabase(String) Method

Definition

Returns a proxy reference to a database.

public virtual Azure.Cosmos.CosmosDatabase GetDatabase (string id);
abstract member GetDatabase : string -> Azure.Cosmos.CosmosDatabase
override this.GetDatabase : string -> Azure.Cosmos.CosmosDatabase
Public Overridable Function GetDatabase (id As String) As CosmosDatabase

Parameters

id
String

The cosmos database id

Returns

Cosmos database proxy

Examples

Database db = cosmosClient.GetDatabase("myDatabaseId"];
DatabaseResponse response = await db.ReadAsync();

Remarks

CosmosDatabase proxy reference doesn't guarantee existence.

Applies to