couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Anderson <>
Subject Re: sample couchdb application
Date Sun, 03 Jan 2010 19:07:21 GMT
On Sun, Jan 3, 2010 at 4:57 AM, Matteo Caprari <> wrote:
> Hello list.
> I've cranked up a simple couchapp that mimics (if you squint).
> The idea is to understand couchdb better and provide the base for a
> tutorial, but
> before going any deeper, I'd like to hear from you what is wrong and
> what is good.

This is great stuff. Really cool. I still don't understand all of how
you've integrated things, but the documentation is really a great

I think this is a really cool use case. Thanks for sharing!

One concern I have is that I don't think you need to be building
custom _ids. You should be able to accomplish your lists and shows
without messing with custom ids, instead using document parameters in
views. Custom ids generally just add code-overhead to apps and
increase the chances of spurious conflicts.

To avoid double posts, PUT with a random docid should be idempotent,
and fail on duplicate PUTs. If you can't do PUT from your client the
_bulk_docs POST api should work to, if you specify ids. See how
jquery.couch.js has an API for getting UUIDs from the Couch and then
using them on new docs.

Also, in trunk _show is no longer happy to have bogus ids, you'll get
a 404. You can invoke with no docid at all to accomplish your use

I'm happy to help more so that when you write your tutorial it
embodies best practices. Just post any questions to this thread!


> So please have a look, but don't expect too much.
> Demo:
> Docs:
> Source:
> Docs are created with jsdoc-toolkit and a custom template.
> I think we could integrate it with couchapp to obtain a "view source" feature.
> --
> :Matteo Caprari

Chris Anderson

View raw message