You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by de...@apache.org on 2014/03/31 21:46:24 UTC

[30/41] couchdb commit: updated refs/heads/Update-Sidebar-Ui to c1e1423

fixed _update function example

It was only checking for req.id existance (it should
always be included in the request) and not its truthiness.


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/597b8d16
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/597b8d16
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/597b8d16

Branch: refs/heads/Update-Sidebar-Ui
Commit: 597b8d1611e951cbff0a8f9521bae2c0694baa5d
Parents: 827b848
Author: BigBlueHat <by...@bigbluehat.com>
Authored: Wed Mar 26 09:38:57 2014 -0400
Committer: BigBlueHat <by...@bigbluehat.com>
Committed: Wed Mar 26 09:38:57 2014 -0400

----------------------------------------------------------------------
 share/doc/src/couchapp/ddocs.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/597b8d16/share/doc/src/couchapp/ddocs.rst
----------------------------------------------------------------------
diff --git a/share/doc/src/couchapp/ddocs.rst b/share/doc/src/couchapp/ddocs.rst
index 754b9b7..4f4664a 100644
--- a/share/doc/src/couchapp/ddocs.rst
+++ b/share/doc/src/couchapp/ddocs.rst
@@ -419,7 +419,7 @@ The basic example that demonstrates all use-cases of update handlers below:
 
     function(doc, req){
         if (!doc){
-            if ('id' in req){
+            if ('id' in req && req['id']){
                 // create new document
                 return [{'_id': req['id']}, 'New World']
             }