couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Shorin <>
Subject Re: [PROPOSAL] Deprecate global functions in query server
Date Wed, 02 Dec 2015 12:42:37 GMT
Hi Garren,

On Wed, Dec 2, 2015 at 3:35 PM, Garren Smith <> wrote:
> This is an interesting idea. I think passing the emit function in is a good idea and
might make somethings easier in PouchDB. I would rather a  map function looked something like
> function (doc, emit) {
> }

That's nice, but won't work: map function has access to a lot of other
global functions we provide, so you'll end with signature of 7
arguments.  I don't think there is any reason to fix this problem by a
half. Just fix all globals or no one.

> I don’t like the idea of passing a userCtx object. That feels overly bulky. Things
like JSON/require are global variables in Node.js or the browser so my feeling is to follow
their lead on those.

ctx referenced not to userCtx, but a generic context object that hold
all the global function and objects we provide now. These are listed
in reference on documentation. May be we can find a better name to not
cause confusion. funcs? env? Suggestions welcome (:


View raw message