語言

CosmosDbKeyEscape.EscapeKey 方法

定義

多載

名稱 Description
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。

EscapeKey(String)

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

public static string EscapeKey(string key);
static member EscapeKey : string -> string
Public Shared Function EscapeKey (key As String) As String

參數

key
String

要逸出的索引鍵。

傳回

可安全地搭配CosmosDB使用的逸出金鑰。

適用於

EscapeKey(String, String, Boolean)

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

public static string EscapeKey(string key, string suffix, bool compatibilityMode);
static member EscapeKey : string * string * bool -> string
Public Shared Function EscapeKey (key As String, suffix As String, compatibilityMode As Boolean) As String

參數

key
String

要逸出的索引鍵。

suffix
String

要加入至所有數據列索引鍵結尾的字串。

compatibilityMode
Boolean

True 是表示 如果應該截斷以相容性模式和金鑰執行,以支援先前的 CosmosDb 密鑰長度上限為 255。 將 CompatibilityMode 設定為 false,即可覆寫此行為。

傳回

可安全地搭配CosmosDB使用的逸出金鑰。

適用於