DocumentDB’s language integrated, transactional execution of JavaScript supports stored procedures, triggers and user defined functions (UDFs) written natively in JavaScript. This allows developers to write application logic which can be shipped and executed directly on the database storage partitions. JavaScript support at the server side has a number of intrinsic advantages that can be utilized to build rich applications.
-
Official documentation can be found the Azure website
-
JSDocs for the Server-Side JavaScript SDK can be found here
-
.NET sample code for creating and executing a sproc can be found on our .NET GitHub repo.
-
Node.js sample code for creating and executing a sproc can be found on our Node.js GitHub repo.
Want to share your awesome stored procedure? Please, send us a pull-request! We’d love to feature and spotlight you on our Github and Twitter accounts.