couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Newson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (COUCHDB-1303) Add a _bulk_update handler similar to _update but for bulk document changes
Date Mon, 09 Dec 2013 14:52:07 GMT

    [ https://issues.apache.org/jira/browse/COUCHDB-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13843214#comment-13843214
] 

Robert Newson commented on COUCHDB-1303:
----------------------------------------

validate_doc_update runs on all updates. An update handler is just a function that runs *before*
a database update, the return value of the update handler includes the update to be attempted.
This is also why an update handler (for a single document) can fail with a 409.

"all or nothing" cannot happen, we are not building a distributed transaction engine. :)

> Add a _bulk_update handler similar to _update but for bulk document changes
> ---------------------------------------------------------------------------
>
>                 Key: COUCHDB-1303
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1303
>             Project: CouchDB
>          Issue Type: New Feature
>            Reporter: Benjamin Young
>              Labels: api, update_request_handler
>
> _update handlers are great (and getting better!) for building RESTful API's inside CouchDB.
One limitation I found tonight is that _update can only do a single document at a time. If
the API I'm building needs to update multiple docs (in a similar fashion to _bulk_docs), then
an outside "proxy" script is required. It would be ideal to have a _bulk_update handler to
allow for the same functionality as _update, but with the ability to insert multiple documents
at once.
> Perhaps the current _update handler API could be extended to support multiple IDs/documents,
but a separate API endpoint would be seem reasonable if needed.
> Thanks for considering this idea.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message