Company
Date Published
Author
Marco Greco, Software Architect, Couchbase
Word count
826
Language
English
Hacker News points
None

Summary

The text discusses the use of N1QL (Couchbase's query language) inside JavaScript user-defined functions, providing two methods for executing N1QL statements: calling directly a function named `N1QL()` or letting the JavaScript compiler detect embedded N1QL statements and produce corresponding `N1QL()` calls. The text explains how to create and use these functions with examples, including dynamic generation of N1QL statements using placeholders, and how to use positional and named parameters. It also covers the role of a transpiler in executing static N1QL statements and building correct `N1QL()` calls behind the scenes.