@cellaware/utils 3.3.33 → 3.3.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/azure/cosmos.js +3 -3
- package/package.json +1 -1
package/dist/azure/cosmos.js
CHANGED
|
@@ -124,10 +124,10 @@ export async function cosmosDelete(databaseId, collectionId, partitionKey, query
|
|
|
124
124
|
const { resources } = await container.items.query({
|
|
125
125
|
query
|
|
126
126
|
}).fetchAll();
|
|
127
|
+
// NOTE: need to remove the '/' at the beginning.
|
|
128
|
+
const partitionKeyColumn = partitionKey.startsWith('/') ? partitionKey.substring(1) : partitionKey;
|
|
127
129
|
resources.forEach(doc => {
|
|
128
|
-
|
|
129
|
-
console.log(doc[partitionKey]);
|
|
130
|
-
container.item(doc.id, doc[partitionKey]).delete();
|
|
130
|
+
container.item(doc.id, doc[partitionKeyColumn]).delete();
|
|
131
131
|
});
|
|
132
132
|
return true;
|
|
133
133
|
}
|