title: Delete documents from Azure cosmos DB collection with multiple Partition Keys
body: <p>I have to delete some documents from azure cosmos DB through azure portal.
  I wrote a stored procedure in container which will delete the data which has to be deleted. 
  But at the time of execution of stored procedure it will ask for partition key value. I have to delete documents which are having different partition keys.</p>
  
  <p>Below given is the Stored Procedure Used.</p>
  
  <pre><code>function bulkDeleteProcedure(deletedate) {
      var collection = getContext().getCollection();
      var collectionLink = collection.getSelfLink();
      var response = getContext().getResponse();
  
      var query = "SELECT * FROM c where c._ts = " + deletedate;
  
      var responseBody = {
          docs_deleted: 0,
          continuation: true
      };
  
      // Validate input.
      if (!query) throw new Error("The query is undefined or null.");
  
      fetchData();
  
      function fetchData(continuation) {
          var requestOptions = {continuation: continuation};
  
          var isAccepted = collection.queryDocuments(collectionLink, query, requestOptions, function (err, items, responseOptions) {
              if (err) throw err;
              // response.setBody(items);
              if (items.length &gt; 0) {
                  // Begin deleting documents as soon as documents are returned form the query results.
                  // tryDelete() resumes querying after deleting; no need to page through continuation tokens.
                  //  - this is to prioritize writes over reads given timeout constraints.
                  tryDelete(items);
                  // response.setBody(items.length + " : inside retrvd docs");
              } else if (responseOptions.continuation) {
                  // Else if the query came back empty, but with a continuation token; repeat the query w/ the token.
                  fetchData(responseOptions.continuation); 
              } else {
                  responseBody.continuation = false;
                  response.setBody(responseBody);
              }
          });
        // If we hit execution bounds - return continuation: true.
          if (!isAccepted) {
              response.setBody(responseBody);
          }
      }
  
  
      // Recursively deletes documents passed in as an array argument.
      // Attempts to query for more on empty array.
      function tryDelete(documents) {
          if (documents.length &gt; 0) {
              // Delete the first document in the array.
              var isAccepted = collection.deleteDocument(documents[0]._self, {}, function (err, responseOptions) {
                  if (err) throw err;
  
                  responseBody.deleted++;
                  documents.shift();
                  // Delete the next document in the array.
                  tryDelete(documents);
              });
  
              // If we hit execution bounds - return continuation: true.
              if (!isAccepted) {
                  response.setBody(responseBody);
              }
          } else {
              // If the document array is empty, query for more documents.
              fetchData();
          }
      }
  
  }
  </code></pre>
  
  <p>Suppose my partition key is vehicle type and I am having vehicle type values as 01 to 10. The sql query as per my requirement will return documents with 10 different partition key values.</p>
  
  <p>Current scenario is like i have to run the stored procedure 10 times by providing each partition key value each time.
  Is it possible to run this stored procedure for different partition key values in a single go?</p>