Book Image

Learning Azure DocumentDB

By : Riccardo Becker
Book Image

Learning Azure DocumentDB

By: Riccardo Becker

Overview of this book

Learning DocumentDB adopts a practical, step-by-step approach to help you learn the basics of DocumentDB and use your new-found abilities in real-life scenarios and enterprise solutions. We start with the absolute basics, such as setting up a DocumentDB environment, and guide you through managing your databases, and executing simple and complex queries. Next, we explain how to work with DocumentDB using the open REST protocol, and demonstrate how JavaScript works with DocumentDB. We’ll also show you how to authenticate and execute queries. Moving on, you’ll find out how to use DocumentDB from within Node.js to kick-start your Node.js projects. Next, you’ll discover how to increase the performance of your DocumentDB database and fine-tune it. Finally, you’ll get to grips with using DocumentDB in conjunction with other services offered from the Microsoft Azure platform.
Table of Contents (15 chapters)
Learning Azure DocumentDB
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building stored procedures


Building a stored procedure is very straightforward. Stored procedures, triggers, and user-defined functions can be created by using the Script Explorer on the Azure portal:

To create a new stored procedure, click on the Create Stored Procedure button.

This stored procedure creates a separate document inside the collection containing the username, action, and date. This stored procedure can be used, for example, in the trigger we create later in this chapter to keep track of all the actions that are performed inside the system. At the time of writing, executing stored procedures from the Query Explorer in the Azure portal was not yet enabled.

Note

At the time of writing, executing stored procedures from the Query Explorer in the Azure portal is not possible.

Try executing this stored procedure by using the code snippets that were provided in Chapter 3, Basic Querying.