How to extend the SQL++ query language by adding your own functions written in JavaScript.
Introduction
SQL++ includes a large number of built-in operations and functions that cover every aspect of data manipulation. User-defined functions enable you to create your own extensions to the language.
Using user-defined functions, you can:
-
Create reuseable, domain-specific functions for use in your applications.
-
Execute complex logic that may be difficult to do in SQL++.
-
Migrate from RDBMS stored procedures.
User-Defined Functions with JavaScript
JavaScript supported in Couchbase shares the same constructs of the ECMAScript. However, you should be aware of the restrictions and extensions that come with the Couchbase implementation. These are covered in JavaScript Functions for Query Reference