Use undefined as the partition key value when deleting and updating documents (#1274)

This commit is contained in:
victor-meng
2022-05-20 16:39:21 -07:00
committed by GitHub
parent 2ab60a7a40
commit dfd5a7c698
2 changed files with 4 additions and 4 deletions

View File

@@ -25,7 +25,7 @@ export const updateDocument = async (
const response = await client()
.database(collection.databaseId)
.container(collection.id())
.item(documentId.id(), documentId.partitionKeyValue)
.item(documentId.id(), documentId.partitionKeyValue?.length === 0 ? undefined : documentId.partitionKeyValue)
.replace(newDocument, options);
logConsoleInfo(`Successfully updated ${entityName} ${documentId.id()}`);