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 your stored procedure, you would like to set the HTTP response to a static string of Test. Which line of JavaScript code should you use to accomplish this task?
context.getResponse().setBody('Test');
context.setBody('Test');
context.getCollection().setBody('Test');
You're authoring a stored procedure in JavaScript and would like to manually roll back a transaction in your code for a certain condition. Which line of code should you use to roll back a transaction?
getContext().rollback();
throw new Error();
return;
Your 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 code block below 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);
Your stored procedure creates three items with three distinct unique identifiers and logical partition key values. When running your stored procedure, you encounter an error. 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.
Continue
Was this page helpful?