共用方式為


CosmosDbKeyEscape.EscapeKey 方法

定義

多載

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 使用的逸出金鑰。

適用於