My Google-fu is weak and I cannot find the answer to the below questions.
What version of Javascript is running the map and reduce functions? Because I have some conditional loops building up an object, I only want to emit it as a value when it actually has properties. This snippet:
Object.keys(value).length
will do the job. But keys() is only available in later versions of Javascript.
Hence, which version of Javascript is running in CB v2.1.1 and what subset of browser Javascript does it support?
I was hoping that you might have a pointer to which built-ins, both CB and JS, are available to view and reduce functions. You answered the CB built-in question. But the other built-ins are as much a part of your platform as the ones CB writes yourselves. Your Javascript is not browser Javascript and has significantly fewer built-in features. Which ones, exactly? With the version of V8, I can track this information down but the Javascript community doesn’t make this easy. (BTW, the node.js people suffer from this problem too.) Hence, if you had a CB preferred reference link to the built-ins supported by your version of V8, then I know what to spend my time mucking with. If you find and “bless” a preferred link, I would hope it would be added to the page describing the CB authored built-ins.
Also, a guide to debugging Javascript problems would be appreciated. I wrote a reduction that caused the database to infinitely loop creating and deleting the view. Apparently, when the reduction does not reduce the data enough, this happens. (Actually, the group reduction was well within the 64KB limit, there are apparently subsequent reductions that force the memory exhaustion.)