incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Lehnardt <...@apache.org>
Subject Re: API within view code
Date Fri, 01 Aug 2008 17:38:41 GMT

On Aug 1, 2008, at 19:17, Demetrius Nunes wrote:

> Hi there,
>
> What's the API available within the scope of the view code? Do I have
> anything else besides the pure JavaScript API? I noticed there is a
> "main.js", should I add any utility functions I wish there?

Yes.


> Also, can I share some state between "map" calls or pass external  
> parameters
> to it besides the default "doc" parameter?

map and reduce functions are meant to run in their own isolated  
environment.
if you need external resources you are possibly doing it wrong[tm].  
While it is
not implemented this way at the moment, map and reduce are meant to  
run on
a distributed set of machines. You'd have to maintain your state on  
all the machines
and synchronise it. This is something you don't really want to do.

Cheers
Jan
--

Mime
View raw message