[
https://issues.apache.org/jira/browse/COUCHDB-1779?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13642672#comment-13642672
]
Dave Cottlehuber commented on COUCHDB-1779:
-------------------------------------------
Hi Sebastian,
It's definitely possible, and a good idea too. You should be able to do almost
all of this already today, using update handlers
http://wiki.apache.org/couchdb/Document_Update_Handlers which you could write
in javascript, and possibly a little bit of Erlang to accept PATCH verbs too.
The update handler would accept a doc id, and the PATCH component, and
internally it will be given by couchdb a copy of the original document, the
full request object, and obviously the new document. Your code then needs to
merge the PATCH and the old doc, and returns that. Be aware that update
handlers can still get conflicts, the only difference to a client-side
equivalent is that it runs on the server.
If you're interested in adding this feature to couch we'll be happy to assist
you along the way! I'd love to see this in the next feature release of couchdb,
whether in JS or Erlang.
> Support of HTTP PATCH method to upload/update attachments in chunks
> -------------------------------------------------------------------
>
> Key: COUCHDB-1779
> URL: https://issues.apache.org/jira/browse/COUCHDB-1779
> Project: CouchDB
> Issue Type: New Feature
> Components: Database Core, HTTP Interface
> Reporter: Sebastian Podjasek
> Priority: Minor
>
> I'm wondering would it be possible to implement PATCH methods for document
> attachments.
> I'm currently facing a theoretical problem to upload large files over GSM
> network, my storage back-end is CouchDB with our own API served in front-end.
> I was thinking about few other solutions, but all of them involves some post
> processing of document after receiving last chunk, it would be great to just
> invoke this:
> PATCH
> /database/0519690fc465fc0e9cc0f89fa87973fc/bigfile.dat?_rev=13-c969cb72e5428ca2ccdd191e0cd7bf4b
> HTTP/1.1
> Content-Type: application/octet-string
> Range: bytes=1200-1300
> Content-Length: 100
> What do you think about this. Is it theoretically possible.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira