# HG changeset patch
# User Atul Varma
# Date 1240271857 25200
# Node ID dbe68e5af673a226aeeee6a9313f0e1e7af0c5de
# Parent b95fc8f8a344a6241ce35bd8d837fc121dc46973
Shortened tutorial code a bit.
diff -r b95fc8f8a344 -r dbe68e5af673 tutorial.html
--- a/tutorial.html Mon Apr 20 16:51:40 2009 -0700
+++ b/tutorial.html Mon Apr 20 16:57:37 2009 -0700
@@ -102,7 +102,7 @@
},
finished: function(result) {
displayInElement(result, 'author-titles-view');
- tryViewWithFindRow();
+ findRows(result);
}
});
}
@@ -131,20 +131,10 @@
one you provide. For example:
-function tryViewWithFindRow() {
- blogDb.view({
- map: function(doc, emit) {
- emit(doc.author, doc.title);
- },
- reduce: function(keys, values) {
- return values;
- },
- finished: function(result) {
- var rowIndex = result.findRow('Thunder');
- displayInElement(result.rows[rowIndex], 'author-find-row-view');
- tryMyView();
- }
- });
+function findRows(result) {
+ var rowIndex = result.findRow('Thunder');
+ displayInElement(result.rows[rowIndex], 'author-find-row-view');
+ tryMyView();
}
@@ -154,11 +144,10 @@
Now You Try!
-If your eyes are crossed right now, no worries—it took me a
-long time to understand exactly what MapReduce was doing, and I
-probably didn't explain it very well either. That said, I also found
-that the easiest way to understand how MapReduce worked was just to
-play around with making my own view.
+If your eyes are crossed right now, no worries—most people
+take a long time to understand exactly what MapReduce is doing. That
+said, the easiest way to understand how MapReduce works is just to
+play around with creating your own view.
So, to get a better feel for how MapReduce works, you can use the
text field below to try making your own view. Just press the tab key