I am trying to create a stored procedure to delete documents in Cosmos Db by using a query. Once the query returns the documents, I would like all the documents to be deleted.
I tried using the script from this website but this requires putting one partition key. My Cosmos collection has a separate partition key per document so it will not work
This is an example of a query I would like to run
SELECT c.currentTime, c.pastTime
FROM C
WHERE c.currentTime < c.pastTime
If that satisfies, I would like to delete all the results from that query.
Is there a way create a stored proc or modify the one in the website provided so it loops through all the collection instead of specifying one partition key?