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

Reply via email to