Source article remembers old map function. Now it's actual.
Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/3017c9af Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/3017c9af Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/3017c9af Branch: refs/heads/1781-reorganize-and-improve-docs Commit: 3017c9af4f5c4a3160735a8ea7e0881e2bf652c7 Parents: ebaf890 Author: Alexander Shorin <[email protected]> Authored: Wed Aug 21 20:49:32 2013 +0400 Committer: Alexander Shorin <[email protected]> Committed: Fri Sep 27 21:59:46 2013 +0400 ---------------------------------------------------------------------- share/doc/src/couchapp/views/joins.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/couchdb/blob/3017c9af/share/doc/src/couchapp/views/joins.rst ---------------------------------------------------------------------- diff --git a/share/doc/src/couchapp/views/joins.rst b/share/doc/src/couchapp/views/joins.rst index 392bf5b..3abae9d 100644 --- a/share/doc/src/couchapp/views/joins.rst +++ b/share/doc/src/couchapp/views/joins.rst @@ -208,7 +208,7 @@ all blog posts, keyed by author: function(doc) { for (var i in doc.comments) { - map(doc.comments[i].author, doc.comments[i].content); + emit(doc.comments[i].author, doc.comments[i].content); } } @@ -286,7 +286,7 @@ ID: function(doc) { if (doc.type == "comment") { - map(doc.post, {author: doc.author, content: doc.content}); + emit(doc.post, {author: doc.author, content: doc.content}); } } @@ -299,7 +299,7 @@ Viewing all comments by author is just as easy as before: function(doc) { if (doc.type == "comment") { - map(doc.author, {post: doc.post, content: doc.content}); + emit(doc.author, {post: doc.post, content: doc.content}); } } @@ -332,9 +332,9 @@ some use of that: function(doc) { if (doc.type == "post") { - map([doc._id, 0], doc); + emit([doc._id, 0], doc); } else if (doc.type == "comment") { - map([doc.post, 1], doc); + emit([doc.post, 1], doc); } }
