How to execute an sample stored procedure in azure server.
I am using cosmos db emulator and whenever i try to execute a sample sp i get this error
Requests originating from scripts cannot reference partition keys other than the one for which client request was submitted.
Stored procedure
function createToDoItem(itemToCreate) {
var context = getContext();
var container = context.getCollection();
console.log("success");
var itemToCreate={
"Id": null,
"UserAccountID": "1742",
"FirstName": "Sanjeev",
"LastName": "S",
"Phone": "12345678",
"Location": "",
"StreetAddress": "vcbgvbvc",
};
itemToCreate.partitionKey = "UserAccountID";
var accepted = container.createDocument(container.getSelfLink(),
itemToCreate,
function (err, itemCreated) {
if (err) throw new Error('Error test' + err.message);
context.getResponse().setBody(itemCreated.id)
});
if (!accepted) return;
}
the sample stored procedure also fails to get the desired results. linking the question here
PartitionKey
you're passing? – Gaurav MantriPartitionKey
attribute. – Gaurav MantriPartitionKey
attribute? Is itUserAccountID
? – Gaurav Mantri