I am trying to use an Azure Functions httpTrigger call to delete an item from my database.
import { CosmosClient, } from \'@azure/cosmos\'
const httpTrigger: A
When retrieving a document via container.item()
, the two parameters are:
The 2nd parameter (partition key) needs to be the value of the partition key. In your example, you had the path to the partition key instead, so it's checking for a partition key value of "/id":
const item = container.item('28a31558-ff8c-40c3-a7e8-1e8904c5ff72', '/id')
This needs to be changed to:
const item = container.item('28a31558-ff8c-40c3-a7e8-1e8904c5ff72', '<partition-key-value')