You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# How to register and use stored procedures, triggers, and user-defined functions in Azure Cosmos DB
17
+
16
18
[!INCLUDE[NoSQL](../includes/appliesto-nosql.md)]
17
19
18
20
The API for NoSQL in Azure Cosmos DB supports registering and invoking stored procedures, triggers, and user-defined functions (UDFs) written in JavaScript. After you define one or more stored procedures, triggers, or user-defined functions, you can load and view them in the [Azure portal](https://portal.azure.com/) by using Data Explorer.
@@ -22,10 +24,13 @@ You can use the API for NoSQL SDK across multiple platforms including [.NET v2 (
22
24
| SDK | Getting started |
23
25
| :--- | :--- |
24
26
| .NET v3 |[Quickstart: Azure Cosmos DB for NoSQL client library for .NET](quickstart-dotnet.md)|
25
-
| Java | [Quickstart: Build a Java app to manage Azure Cosmos DB for NoSQL data](quickstart-java.md)
27
+
| Java |[Quickstart: Build a Java app to manage Azure Cosmos DB for NoSQL data](quickstart-java.md)|
26
28
| JavaScript |[Quickstart: Azure Cosmos DB for NoSQL client library for Node.js](quickstart-nodejs.md)|
27
29
| Python |[Quickstart: Azure Cosmos DB for NoSQL client library for Python](quickstart-python.md)|
28
30
31
+
> [!IMPORTANT]
32
+
> The following code samples assume that you have already have `client` and `container` variables. If you need to create those variables, refer to the appropriate quickstart for your platform.
33
+
29
34
## How to run stored procedures
30
35
31
36
Stored procedures are written using JavaScript. They can create, update, read, query, and delete items within an Azure Cosmos DB container. For more information, see [How to write stored procedures](how-to-write-stored-procedures-triggers-udfs.md#stored-procedures).
@@ -232,18 +237,18 @@ result = container.scripts.execute_stored_procedure(sproc=created_sproc,params=[
232
237
233
238
---
234
239
235
-
## How to runpre-triggers
240
+
## <aid="how-to-run-pre-triggers"></a>How to run pretriggers
236
241
237
-
The following examples show how to register and call a pre-trigger by using the Azure Cosmos DB SDKs. For the source of this pre-trigger example, saved as *trgPreValidateToDoItemTimestamp.js*, see [Pre-triggers](how-to-write-stored-procedures-triggers-udfs.md#pre-triggers).
242
+
The following examples show how to register and call a pretrigger by using the Azure Cosmos DB SDKs. For the source of this pretrigger example, saved as *trgPreValidateToDoItemTimestamp.js*, see [Pretriggers](how-to-write-stored-procedures-triggers-udfs.md#pre-triggers).
238
243
239
-
When you run an operation by specifying `PreTriggerInclude` and then passing the name of the trigger in a `List` object, pre-triggers are passed in the `RequestOptions` object.
244
+
When you run an operation by specifying `PreTriggerInclude` and then passing the name of the trigger in a `List` object, pretriggers are passed in the `RequestOptions` object.
240
245
241
246
> [!NOTE]
242
247
> Even though the name of the trigger is passed as a `List`, you can still run only one trigger per operation.
243
248
244
249
### [.NET SDK v2](#tab/dotnet-sdk-v2)
245
250
246
-
The following code shows how to register a pre-trigger using the .NET SDK v2:
251
+
The following code shows how to register a pretrigger using the .NET SDK v2:
0 commit comments