Share via


CosmosDbKeyEscape 類別

定義

用於逸出 Cosmos DB 之金鑰的協助程式方法。

public static class CosmosDbKeyEscape
type CosmosDbKeyEscape = class
Public Class CosmosDbKeyEscape
繼承
CosmosDbKeyEscape

欄位

MaxKeyLength

較舊的程式庫的金鑰長度上限為 255。 限制現在是 1023。 在此程式庫中,255 會保留回溯相容性的預設值。 若要覆寫此行為,並使用較長的限制,請將 CosmosDbPartitionedStorageOptions.CompatibilityMode 設定為 false。 https://docs.microsoft.com/en-us/azure/cosmos-db/concepts-limits#per-item-limits.

方法

EscapeKey(String)

將金鑰轉換成可安全地搭配 Cosmos DB 使用的 DocumentID。 下列字元受到限制,而且不能用於 Id 屬性:'/'、''、'?'和 '#'。 如需詳細資訊,請參閱 https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.resource.id?view=azure-dotnet

EscapeKey(String, String, Boolean)

將金鑰轉換成可安全地搭配 Cosmos DB 使用的 DocumentID。 下列字元受到限制,而且不能用於 Id 屬性:'/'、''、'?'和 '#'。 如需詳細資訊,請參閱 https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.resource.id?view=azure-dotnet

適用於