incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dean Landolt" <>
Subject Re: API within view code
Date Fri, 01 Aug 2008 17:45:45 GMT
> What's the API available within the scope of the view code? Do I have
> anything else besides the pure JavaScript API?

If you're asking is there any way you can write views, there is -- I've
played around with python views in Chris Lenz's beautiful couchdb-python
library. I've read the python views are quite a bit slower, but I've been
working with tiny datasets so far so I wouldn't know.

If you're asking whether you can talk to couch or tinker with the internals
in the view code, I don't know for sure, but I doubt it. In order to get the
benefit of instant reads once the view indexes are built, the only data that
can really matter to the view is data from documents themselves -- otherwise
couch wouldn't know how to incrementally update the views...

But I could be wrong (and kinda hope I am)...

> I noticed there is a
> "main.js", should I add any utility functions I wish there?

I think that's the idea.

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

While I also find myself yearning for a way to get at a view from another
view, you might want to watch your language -- I think "*share some state*"
is a curse word to the functional programmers among us ;)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message