I've built a custom query server for a custom query language.
I've tried to create a design document with views map/reduce
.
In those map/reduce
functions (most importantly in the map function) I want to be able to reference library code.
I can see there is a lib node that can be added to the design document.
I am expecting the custom query server to receive add_lib
message from CouchDB, but I have never seen this yet.
http://docs.couchdb.org/en/stable/query-server/protocol.html#add-lib
add_fun
messages fail for code that depends on the library in the query server because the add_lib
message has not yet been received in advance.
"The Query Server should parse, compile, and evaluate the function it receives to make it callable later."
http://docs.couchdb.org/en/stable/query-server/protocol.html#add-fun
Since add_fun
fails, this means that I am unable to save the design document.
I have viewed the following pages but I still no success:
How do I add the moment.js library to Cloudant NoSQL Design Doc on Bluemix
How do I DRY up my CouchDB views?
https://www.oreilly.com/library/view/couchdb-the-definitive/9780596158156/ch05.html
I'm doing something wrong or made a mistake it seems, your help is greatly appreciated.