CouchDB view javascript only supports a subset of JS features?

28 Views Asked by At

I am trying to write a few map functions to create views in a CouchDB database. Futon kept telling me that the script I wrote is not a valid function - despise that I used mostly standard JS features. After some debugging, I found that if I use standard string.match(//), string.replace(//,''), array.filter(), array.map() calls, or lambda functions ((x) => x * 2), it will fail to save the document.

This gives me the feeling that couchdb only supports a subset of JS, but could not find a document on what JS features are not supported.

Can someone let me know if such document exist? why couchjs does not support standard JS functions?

my server has couchdb v3.3.2.

0

There are 0 best solutions below