On Wed, Jul 9, 2008 at 4:10 AM, Troy Kruthoff <[EMAIL PROTECTED]> wrote:
> Regarding previous discussions about multi-key gets, I was thinking why not
> just bring bulk_docs into parity with the rest buzzword we're a giddy about.
> Example, instead of
>
> {
> "docs": [
> {"_id": "0", "integer": 0, "string": "0"},
> {"_id": "1", "integer": 1, "string": "1"},
> {"_id": "2", "integer": 2, "string": "2"}
> ]
> }
>
> do
>
> {
> "put[||post]": [
> {"_id": "0", "integer": 0, "string": "0"},
> {"_id": "1", "integer": 1, "string": "1"},
> {"_id": "2", "integer": 2, "string": "2"}
> ]
> }
>
> so later, when supported we could do cool stuff like:
>
> {
> "get": ["id1","id2","id3"]
> }
>
> and/or even cooler
>
> {
> "get": [
> {startkey:"a", endkey:"b", count:100},
> {startkey:"c", endkey:"d", count:100},
> {startkey:"e", endkey:"f", count:100}
> ]
> }
>
> and/or even bulky crazy
>
> {
> "get": [
> {startkey:"a", endkey:"b", count:100},
> {startkey:"c", endkey:"d", count:100},
> {startkey:"e", endkey:"f", count:100}
> ],
> "put[||post]": [
> {"_id": "0", "integer": 0, "string": "0"},
> {"_id": "1", "integer": 1, "string": "1"},
> {"_id": "2", "integer": 2, "string": "2"}
> ],
> "delete": ["id1","id2","id3"]
> }
>
>
> For me, keeping the concepts of rest exposed through the bulk_docs api just
> seems sexy. I'd take a crack at this, but it would take awhile, as Erlang
> and I have yet to dance, although my beer goggles are starting to work, so
> it may not be long! -- Meaning Erlang sure is ugly, but couchdb (and
> ejabberd) are starting to make it look attractive (for me anyways...)
>
> -- troy
>
I'm suprisingly liking this idea. IIRC, there's already code in the
couch_view.erl to do this insert/delete/fetch in one pass through the
view which makes me think it wouldn't actually be that hard to
implement.
Any core developers want to chime in with a slap down or blessing for
attempting to implement it?
Paul