Hey Marc,
I hope you don't mind: I am CC'ing our couchdb-users mailing list,
so others can benefit from the discussion:

On Apr 23, 2008, at 04:28, Marc Chung wrote:
I was at MtnWestRuby and had a chance to ask you questions over lunch
about CouchDB.  In the talk you gave, you mentioned a few features
which made me interested in checking Couchdb out.  1) storing and
serving up HTML files from within a record, and 2) using a Map/Reduce
like API for view collation and 3) creating new records from within my
_view functions for, say, creating an inverted index .  Are these
features implemented in Couchdb 0.74?  I haven't had much luck finding
documentation on them.  If I want to say, write a webapp using nothing
but Javascript, does my Javascript live in a _design/ record, or..
somewhere else?  I noticed the installation direction[1] contains a
good place to put my code.  Is that the convention?

-Marc

[1] /opt/local/share/couchdb/www, which contains "index.html" etc.


1) The place to store HTML files like I mentioned in Salt Lake would
be a document's attachment: Look for "Attachments" at
http://wiki.apache.org/couchdb/HttpDocumentApi on how to do this.
Each attachment then has  URI that you can call from a browser
that serves your application. In fact the (botched) demo I gave
worked that way.

You could store files into the [1] directory, but that is reserved for
CouchDB-related things, so for testing, it is fine, but for an actual
app, you'd do attachments.

I do have a small script that loads a bunch of files into document,
I added this to the wiki:

http://wiki.apache.org/couchdb/ServingAppsFromCouchDb

Note that you wouldn't want to run a publicly facing application here,
since CouchDB does not yet have a security concept, so everyone
could do anything. You could put an access restricting proxy in
front of CouchDB though. For local/private apps, this is fine as well.

2) We have the Map, the Reduce is in the works, see:
http://wiki.apache.org/couchdb/HttpViewApi

3) You can't create new records from within a view function, but
the view function would be able to create a reversed index, that
you can query. IIRC that is possible with the map we have in
place already.

Cheers
Jan
--

Reply via email to