Fix error when reading document with no partition key (#1256)
This commit is contained in:
parent
22f7d588a1
commit
56731ec051
|
@ -21,7 +21,8 @@ export const readDocument = async (collection: CollectionBase, documentId: Docum
|
|||
const response = await client()
|
||||
.database(collection.databaseId)
|
||||
.container(collection.id())
|
||||
.item(documentId.id(), documentId.partitionKeyValue)
|
||||
// use undefined if the partitionKeyValue is empty
|
||||
.item(documentId.id(), documentId.partitionKeyValue?.length === 0 ? undefined : documentId.partitionKeyValue)
|
||||
.read(options);
|
||||
|
||||
return response?.resource;
|
||||
|
|
Loading…
Reference in New Issue