共用方式為


ConnectionPolicy interface

代表 Azure Cosmos DB 資料庫服務中與 CosmosClient 相關聯的連線原則。

屬性

connectionMode

決定要連線到 Cosmos 的模式。 (目前僅支援閘道選項)

enableBackgroundEndpointRefreshing

啟用/停用端點背景重新整理的旗標。 默認值為 false。 使用 enableEndpointsDiscovery 的端點探索仍適用於失敗的要求。

enableEndpointDiscovery

旗標,以根據讀取/寫入作業啟用/停用要求的自動重新導向。 默認值為 true。 在終結另一個進程或瀏覽器中的 CosmosClient 之後,呼叫 client.dispose() 時,呼叫 client.dispose() 的必要專案。

endpointRefreshRateInMs

以毫秒為單位的速率,用戶端會在背景重新整理端點清單

preferredLocations

要作為讀取要求慣用位置的 Azure 區域清單。

requestTimeout

要求逾時(等候來自網路對等互連的回應時間)。 以毫秒表示。

retryOptions

RetryOptions 物件,定義重試期間使用的數個可設定屬性。

useMultipleWriteLocations

旗標,可針對 Azure Cosmos DB 服務中的異地復寫資料庫帳戶,針對任何位置(區域)進行寫入。 預設值為 false

屬性詳細資料

connectionMode

決定要連線到 Cosmos 的模式。 (目前僅支援閘道選項)

connectionMode?: Gateway

屬性值

enableBackgroundEndpointRefreshing

啟用/停用端點背景重新整理的旗標。 默認值為 false。 使用 enableEndpointsDiscovery 的端點探索仍適用於失敗的要求。

enableBackgroundEndpointRefreshing?: boolean

屬性值

boolean

enableEndpointDiscovery

旗標,以根據讀取/寫入作業啟用/停用要求的自動重新導向。 默認值為 true。 在終結另一個進程或瀏覽器中的 CosmosClient 之後,呼叫 client.dispose() 時,呼叫 client.dispose() 的必要專案。

enableEndpointDiscovery?: boolean

屬性值

boolean

endpointRefreshRateInMs

以毫秒為單位的速率,用戶端會在背景重新整理端點清單

endpointRefreshRateInMs?: number

屬性值

number

preferredLocations

要作為讀取要求慣用位置的 Azure 區域清單。

preferredLocations?: string[]

屬性值

string[]

requestTimeout

要求逾時(等候來自網路對等互連的回應時間)。 以毫秒表示。

requestTimeout?: number

屬性值

number

retryOptions

RetryOptions 物件,定義重試期間使用的數個可設定屬性。

retryOptions?: RetryOptions

屬性值

useMultipleWriteLocations

旗標,可針對 Azure Cosmos DB 服務中的異地復寫資料庫帳戶,針對任何位置(區域)進行寫入。 預設值為 false

useMultipleWriteLocations?: boolean

屬性值

boolean