add ContributorGroup link
official docs link
|Deletions are marked like this.||Additions are marked like this.|
|Line 5:||Line 5:|
See also the [[http://docs.couchdb.org/en/latest/query-servers.html#require|official documentation]] for this topic.
See also the official documentation for this topic.
As of the 1.1 release of CouchDB you can use CommonJS 1.0 modules in your map, show, list, update, and validation functions. Reduce functions can NOT use modules. When using CommonJS in map function you must place your CommonJS under the views/lib property in your Design Document (see below).
Within a show function you can require CommonJS modules that are defined within object in your design document. The id you pass to require() is a / delimited list of property names to resolve the module string within the design document.
All imports are relative to the design document root unless they start with ./ or ../, these are referred to as "relative require" statements. Relative require statements only work within CommonJS modules they cannot be used directly inside your show, list, update and validation functions.