CosmosDbKeyEscape Class
- java.
lang. Object - com.
microsoft. bot. azure. CosmosDbKeyEscape
- com.
public final class CosmosDbKeyEscape
Helper class to escape CosmosDB keys.
Field Summary
| Modifier and Type | Field and Description |
|---|---|
| static final java.lang.Integer |
MAX_KEY_LENGTH
Older libraries had a max key length of 255. |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
| static java.lang.String |
escapeKey(String key)
Converts the key into a DocumentID that can be used safely with Cosmos DB. |
| static java.lang.String |
escapeKey(String key, String suffix, Boolean compatibilityMode)
Converts the key into a DocumentID that can be used safely with Cosmos DB. |
Methods inherited from java.lang.Object
Field Details
MAX_KEY_LENGTH
public static final Integer MAX_KEY_LENGTH
Older libraries had a max key length of 255. The limit is now 1023. In this library, 255 remains the default for backwards compat. To override this behavior, and use the longer limit set CosmosDbPartitionedStorageOptions.CompatibilityMode to false. https://docs.microsoft.com/en-us/azure/cosmos-db/concepts-limits\#per-item-limits.
Method Details
escapeKey
public static String escapeKey(String key)
Converts the key into a DocumentID that can be used safely with Cosmos DB.
Parameters:
Returns:
escapeKey
public static String escapeKey(String key, String suffix, Boolean compatibilityMode)
Converts the key into a DocumentID that can be used safely with Cosmos DB.
Parameters:
Returns: