I have a collection which has PartitionKey.i have a made a stored procedure which accepts query as a parameter. in this stored procedure, I'm fetching some documents to update but while fetching it shows an error saying provide PartitionKey when I use the method
public Task<StoredProcedureResponse<TValue>> ExecuteStoredProcedureAsync<TValue>(Uri storedProcedureUri, [Dynamic(new[] { false, true })] params dynamic[] procedureParams);
while using the other method
public Task<StoredProcedureResponse<TValue>> ExecuteStoredProcedureAsync<TValue>(string storedProcedureLink, RequestOptions options, [Dynamic(new[] { false, true })] params dynamic[] procedureParams);
in this method, I have Pass the PartitionKey as
new RequestOptions { PartitionKey = new PartitionKey(Undefined.Value)
while using this RequestOptions in the Stored Procedure no Document is Fetch.
function ABC(query) {
var collection = getContext().getCollection();
var collectionLink = collection.getSelfLink();
var response = getContext().getResponse();
// Validate input.
if (!query) throw new Error("The query is undefined or null.");
tryQueryAndDelete();
function tryQueryAndDelete(continuation) {
var requestOptions = { continuation: continuation };
var isAccepted = collection.queryDocuments(collectionLink, query, requestOptions, function (err, retrievedDocs, responseOptions) {
if (err) throw err;
if (retrievedDocs.length > 0) {
console.log("Doc Found");
} else {
console.log("Doc not Found");
}
});
}
}
is there anyway so that I can fetch the documents without passing the PartitionKey?