rnewson commented on issue #1021: CouchDB 2.1: _users database update handlers 
always invoked with null first parameter
URL: https://github.com/apache/couchdb/issues/1021#issuecomment-347347491
 
 
   ```
   ?  ~ curl 'foo:bar@localhost:15984/db1/_design/bar' -XPUT -d   
'{"updates":{"inc":"function(doc, req) { if (doc) {doc.count++} else {doc = 
{\"_id\": req.id, \"count\" : 1}}; return [doc, \"yay\"]; }"}}'
   {"ok":true,"id":"_design/bar","rev":"1-36845b033830eab695afb0b562f48c0d"}
   
   ?  ~  curl 'foo:bar@localhost:15984/db1/_design/bar/_update/inc/doc1' -XPUT
   yay%                                                                         
                                                                                
                                               
   
   ?  ~ curl 'foo:bar@localhost:15984/db1/doc1'
   {"_id":"doc1","_rev":"1-74620ecf527d29daaab9c2b465fbce66","count":1}
   
   ?  ~ curl foo:bar@localhost:15984/db1/_design/foo/_update/inc/doc1 -XPUT
   yay% 
                                                                                
                                                                                
                                          ?  ~ curl 
'foo:bar@localhost:15984/db1/doc1'
   {"_id":"doc1","_rev":"2-de0ea16f8621cbac506d23a0fbbde08a","count":2}
   ```
   
   seems to work in non-system db.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to