This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
At the end of the stored procedure, the HTTP response should be set to a static string of Test. Which line of JavaScript code should be used to accomplish this task?
context.getResponse().setBody('Test');
context.setBody('Test');
context.getCollection().setBody('Test');
While authoring a stored procedure in JavaScript, a manual rollback of a transaction is required under a certain condition. Which line of code should be used to roll back the transaction?
getContext().rollback();
throw new Error();
return;
The application code contains a variable of type Microsoft.Azure.Cosmos.Container named container and another variable of type Microsoft.Azure.Cosmos.Scripts.StoredProcedureProperties named props. Which of the following code blocks would asynchronously create a new stored procedure using the two variables?
await container.StoredProcedures.CreateStoredProcedureAsync(props);
await container.CreateStoredProcedureAsync(props);
await container.Scripts.CreateStoredProcedureAsync(props);
A stored procedure creates three items with three distinct unique identifiers and logical partition key values. When running the stored procedure, an error occurs. What is the cause for this error?
Stored procedures are scoped to only a single item
Stored procedures are scoped to only a single logical partition
Stored procedures are scoped to only a single unique identifier
You must answer all questions before checking your work.
Was this page helpful?