You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Jan Lehnardt <ja...@apache.org> on 2008/04/23 09:34:37 UTC

Re: Couchdb at MtnWest

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
--

Re: Couchdb at MtnWest

Posted by Jan Lehnardt <ja...@apache.org>.
On Apr 23, 2008, at 14:55, Michael Fisher wrote:
>
> I am running version 0.6.4 on Windows and am wondering if this has  
> been
> implemented at this time or am I doing something incorrect?

You definitely do want a 0.7 release or even SVN trunk. 0.6.x is
totally out of date (still uses XML instead of JSON, Fabric instead
of JavaScript, no Map/Reduce etc…). Unfortunately, we don't
have a windows package ready to use. Since we use autotools,
you should[tm] be able to to build in Cygwin, but as far as I know
(and what do I know?), nobody did that, yet.

Cheers
Jan
--

Re: Couchdb at MtnWest

Posted by Michael Fisher <de...@gmail.com>.
On Wed, Apr 23, 2008 at 3:34 AM, Jan Lehnardt <ja...@apache.org> wrote:

> 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
> --
>


First, thanks for the info on enhancements to CouchDB views. I am new to
playing with CouchDB but have a of experience with developing Notes so I
understand the concept.

I tried the various view query arguments and got them to work with the
exception of 'descending=true' I am using the following URL for testing:

http://localhost:8888/testcouch/_all_docs?descending=true

I am running version 0.6.4 on Windows and am wondering if this has been
implemented at this time or am I doing something incorrect?

Thanks,

Mike
desnotes@gmail.com