Search code examples
couchbasecouchbase-view

custom global function, used in Couchbase views


I have a JavaScript library which I want to use from map functions in Couchbase views. Is there a way to install this library in some "global" way, so it will be available from all view definitions I create?


Solution

  • Not without modifying Couchbase's source code, no :)

    There's of course nothing stoping you from duplicating the definition of the function for each view. The only thing lost in this approach is maintainability (if the function changes, you'd need to update every map function using it).