Couchbase Server 7.0 introduced N1QL User Defined Functions (UDFs), which allow for the inclusion of bespoke business logic in queries, bridging a gap in previous versions. These UDFs can be written in several languages, with a particular focus on JavaScript in this context. They come in two forms: cluster-wide, suitable for those not using collections, and scope-bound, allowing for different logic across scopes. JavaScript UDFs in Couchbase are managed externally via the jsevaluator, which supports only plain JavaScript and does not allow global state to prevent unexpected results in concurrent requests. The 7.1 release enhances the JavaScript engine to execute multiple N1QL statements, supports iterators and transactions, and introduces a hierarchical storage system for JavaScript libraries, making them accessible at different levels and scopes. A new user interface also simplifies the manipulation of JavaScript libraries and UDFs, although it currently lacks advanced features like a debugger.