You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Benjamin Young (Created) (JIRA)" <ji...@apache.org> on 2011/10/06 02:04:29 UTC

[jira] [Created] (COUCHDB-1303) Add a _bulk_update handler similar to _update but for bulk document changes

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


_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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Re: [jira] [Created] (COUCHDB-1303) Add a _bulk_update handler similar to _update but for bulk document changes

Posted by Benoit Chesneau <bc...@gmail.com>.
On Thursday, October 6, 2011, Benjamin Young (Commented) (JIRA) <
jira@apache.org> wrote:
>
>    [
https://issues.apache.org/jira/browse/COUCHDB-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13121623#comment-13121623]
>
> Benjamin Young commented on COUCHDB-1303:
> -----------------------------------------
>
> Others have hit this situation as well:
http://stackoverflow.com/questions/4061766/couch-db-bulk-update-using-handlers/7669106
>
>> 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 is automatically generated by JIRA.
> If you think it was sent incorrectly, please contact your JIRA
administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>

I would really prefer to sit down a little and start to rethink the couchapp
engine. Restful means imo  that on a particular resource we could react on
each actions (here HTTP verbs). Instead we did the same error Rails did by
having a resource per actions or so. Bulk updates would be another hack
around this so I'm -1 on such features. New ticket about what i would like
to design is coming along.

[jira] [Commented] (COUCHDB-1303) Add a _bulk_update handler similar to _update but for bulk document changes

Posted by "Benoit Chesneau (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13121989#comment-13121989 ] 

Benoit Chesneau commented on COUCHDB-1303:
------------------------------------------

posted on dev@ , copied here.

I would really prefer to sit down a little and start to rethink the couchapp engine. Restful means imo  that on a particular resource we could react on each actions (here HTTP verbs). Instead we did the same error Rails did by having a resource per actions or so. Bulk updates would be another hack around this so I'm -1 on such features. New ticket about what i would like to design is coming along.
                
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COUCHDB-1303) Add a _bulk_update handler similar to _update but for bulk document changes

Posted by "Benjamin Young (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13121623#comment-13121623 ] 

Benjamin Young commented on COUCHDB-1303:
-----------------------------------------

Others have hit this situation as well: http://stackoverflow.com/questions/4061766/couch-db-bulk-update-using-handlers/7669106
                
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (COUCHDB-1303) Add a _bulk_update handler similar to _update but for bulk document changes

Posted by "Benjamin Young (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/COUCHDB-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13122013#comment-13122013 ] 

Benjamin Young commented on COUCHDB-1303:
-----------------------------------------

I do agree that the more the more "RESTful" thing to do would actually be allowed to POST to the /db/ URL with a specific mimetype that designated that one was sending a representation containing several documents to be added (which of course could use it's own ticket). However, as we allow end users to extend CouchDB's functionality with "CouchApp" additions (which is fabulous!), we need to offer them as much power as possible so this can move out of being a "toy" (for some) into being a viable "stack."

The develoepr generated additions (such as _update handlers) can live wherever they need to in the CouchDB URL space (all of them are currently under _design/{app}), as long as they are wrap-able by the URL rewriter, the developer can make their own API's and vhost them wherever they'd like.

That's the goal of this request. I agree that the whole CouchApp approach/concept could use a fresh approach, but I'm not sure it's a good reason to stall what we have moving now.

I look forward to seeing your CouchApp-related proposals, but I'd prefer this (and any other) idea be measured on its merits relative to the current code--not potential rewrites. There are likely other reasons this might be bad, but "because we should start over" isn't one of them. :)
                
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira