[jira] Updated: (COUCHDB-802) Doc ID should auto-generate if not provided, before sending to _update function [PATCH]
[ https://issues.apache.org/jira/browse/COUCHDB-802?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zachary Zolton updated COUCHDB-802: --- Attachment: COUCHDB-802-with-test.diff Will this test suffice? (^_^) Doc ID should auto-generate if not provided, before sending to _update function [PATCH] --- Key: COUCHDB-802 URL: https://issues.apache.org/jira/browse/COUCHDB-802 Project: CouchDB Issue Type: Bug Components: HTTP Interface, JavaScript View Server Affects Versions: 0.11 Environment: Linux Reporter: Jason Smith Priority: Minor Fix For: 0.11.1 Attachments: COUCHDB-802-with-test.diff, new_id.diff Original Estimate: 24h Remaining Estimate: 24h The main bug is this: _show and _update functions should be able to mimic the standard HTTP/JSON API. A common pattern people are moving to is rewriting to _show and _update, so the client thinks it is hitting normal couch, however additional logic happens (e.g. auto-timestamping). Unfortunately, _update cannot return an auto-generated ID for POST to /db/_design/ddoc/_update. The semantics should match POST to /db/ -- If an _id is provided, use that; otherwise auto-generate one. The best an _update function can do now is Math.random() or similar; however one loses the advantage of sequential UUID generation from couch's internals. The fix is for couch to send a random UUID if the update URL did not include the final /Id component. The function itself in the view server can decide whether to use it. Assuming that change, the update function could at least be capable of duplicating the direct API using the following Javascript logic: function(doc, req) { if(doc doc._id == req.id) { // To be pedantic, I could confirm req.method == PUT log(I am an update by id); } else if(doc === null req.id) { if(req.method == POST) { log(I am a create, id was auto-generated); } else if(req.method == PUT) { log(I am a create, id was supplied by client); } } } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (COUCHDB-699) Allow for bind variables in complex query keys for URL rewriter
Allow for bind variables in complex query keys for URL rewriter --- Key: COUCHDB-699 URL: https://issues.apache.org/jira/browse/COUCHDB-699 Project: CouchDB Issue Type: Improvement Components: HTTP Interface Affects Versions: 0.11 Environment: CouchDB 0.11.x branch Reporter: Zachary Zolton Priority: Minor Enhance URL rewriter module to substitute bound variables in complex query parameters. Given the URL rewrite rule: { from: /events/:year, to: _list/event-list/events-by-date, method: GET, query: { startkey: [:year], endkey: [:year, {}] } } A request like: /db/_design/ddoc/_rewrite/events/1980 Should rewrite to: /db/_design/ddoc/_list/event-list/events-by-date?startkey=[1980]endkey=[1980,{}] (URI encoding of the query parameter values notwithstanding.) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (COUCHDB-514) Redirect from _list using view rows
Redirect from _list using view rows --- Key: COUCHDB-514 URL: https://issues.apache.org/jira/browse/COUCHDB-514 Project: CouchDB Issue Type: Improvement Components: JavaScript View Server Affects Versions: 0.10 Reporter: Zachary Zolton There is no way to redirect from a _list function after calling the getRow() API function. Here's a link to the discussion on the dev mailing list: http://is.gd/3KZRg -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (COUCHDB-514) Redirect from _list using view rows
[ https://issues.apache.org/jira/browse/COUCHDB-514?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zachary Zolton updated COUCHDB-514: --- Attachment: list-redir.diff This patch (from a reasonably current HEAD on github) shows how I was attempting to get the JavaScript view server to defer sending the headers until after the first time send() is called. Unfortunately, this code doesn't work, but I'm attaching it here to encourage some dialog... :^D Redirect from _list using view rows --- Key: COUCHDB-514 URL: https://issues.apache.org/jira/browse/COUCHDB-514 Project: CouchDB Issue Type: Improvement Components: JavaScript View Server Affects Versions: 0.10 Reporter: Zachary Zolton Attachments: list-redir.diff There is no way to redirect from a _list function after calling the getRow() API function. Here's a link to the discussion on the dev mailing list: http://is.gd/3KZRg -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Created: (COUCHDB-513) Unable to redirect from _list function
Unable to redirect from _list function -- Key: COUCHDB-513 URL: https://issues.apache.org/jira/browse/COUCHDB-513 Project: CouchDB Issue Type: Bug Components: JavaScript View Server Affects Versions: 0.11 Environment: Mac OS X 10.5.8, Erlang OTP/R12B, CouchDB/0.11.0a9fd42dc1 Reporter: Zachary Zolton Priority: Minor Define this _list function: function(head, req) { return { 'code': 301, 'headers': { 'Location': 'http://www.google.com/' } }; } Try to curl it: $ curl -i 'http://localhost:5984/db/_design/ddoc/_list/test-redirect/some-view?key=%22foo%22' HTTP/1.1 200 OK Vary: Accept Transfer-Encoding: chunked Server: CouchDB/0.11.0a9fd42dc1-git (Erlang OTP/R12B) Etag: 46014W5JDRLKZF5SECP2D44YH Date: Thu, 24 Sep 2009 22:23:14 GMT Content-Type: application/json curl: (56) Received problem 2 in the chunky parser Here is Jan's take on the user mailing list: http://mail-archives.apache.org/mod_mbox/couchdb-user/200909.mbox/%3c6678e46d-a113-4052-9f44-e061582d2...@apache.org%3e -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Commented: (COUCHDB-296) A built-in conflicts view
[ https://issues.apache.org/jira/browse/COUCHDB-296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=12742923#action_12742923 ] Zachary Zolton commented on COUCHDB-296: I think this is a duplicate of COUCHDB-462 track conflict count in db_info (was built-in conflicts view). So, we should probably close this out, right? A built-in conflicts view - Key: COUCHDB-296 URL: https://issues.apache.org/jira/browse/COUCHDB-296 Project: CouchDB Issue Type: New Feature Components: Database Core Affects Versions: 0.9 Reporter: Dirkjan Ochtman Priority: Minor Fix For: 0.10 It would be great if CouchDB came with a built-in db/_conflicts view. It could have code like the current test/view_conflicts.js. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (COUCHDB-190) _uuid should respond to GET, not POST
[ https://issues.apache.org/jira/browse/COUCHDB-190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zachary Zolton updated COUCHDB-190: --- Attachment: (was: COUCHDB-190.diff) _uuid should respond to GET, not POST - Key: COUCHDB-190 URL: https://issues.apache.org/jira/browse/COUCHDB-190 Project: CouchDB Issue Type: Improvement Components: Database Core Affects Versions: 0.9 Reporter: Matt Goodall Priority: Blocker Fix For: 0.9 The /_uuid resource can happily return a response to a GET without being unresty. In fact, supporting POST is probably incorrect as it implies it would change server state. Quick summary: * _uuid never changes server state * calling _uuid multiple times does not impact other clients * that the resource returns something different each time it is requested does not mean it cannot be a POST * GET with proper cache control (i.e. don't cache it ever) will work equally well Full discussion can be found on the user m.l., http://mail-archives.apache.org/mod_mbox/couchdb-user/200901.mbox/%3c21939021.1440421230910477169.javamail.serv...@perfora%3e. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.
[jira] Updated: (COUCHDB-190) _uuid should respond to GET, not POST
[ https://issues.apache.org/jira/browse/COUCHDB-190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Zachary Zolton updated COUCHDB-190: --- Attachment: COUCHDB-190.diff * Changed the _uuids handler to use the GET method. * Updated the uuid tests to use the GET method. * Added test to ensure 405 status is returned for POST requests. * Updated CouchDB.newUuids() function to use GET. _uuid should respond to GET, not POST - Key: COUCHDB-190 URL: https://issues.apache.org/jira/browse/COUCHDB-190 Project: CouchDB Issue Type: Improvement Components: Database Core Affects Versions: 0.9 Reporter: Matt Goodall Priority: Blocker Fix For: 0.9 Attachments: COUCHDB-190.diff The /_uuid resource can happily return a response to a GET without being unresty. In fact, supporting POST is probably incorrect as it implies it would change server state. Quick summary: * _uuid never changes server state * calling _uuid multiple times does not impact other clients * that the resource returns something different each time it is requested does not mean it cannot be a POST * GET with proper cache control (i.e. don't cache it ever) will work equally well Full discussion can be found on the user m.l., http://mail-archives.apache.org/mod_mbox/couchdb-user/200901.mbox/%3c21939021.1440421230910477169.javamail.serv...@perfora%3e. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.