Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated to use emit

  • Loading branch information...
commit 07763cb17230daabe045bf9b84527b54db71612a 1 parent 0b2d1bb
goobsoft authored
View
2  README.TXT
@@ -84,7 +84,7 @@ for (Document d: result.getResults()) {
// Ad-Hoc view
-ViewResult resultAdHoc = db.adhoc("function (doc) { if (doc.foo=='bar') { return doc; }}");
+ViewResult resultAdHoc = db.adhoc("function (doc) { if (doc.foo=='bar') { emit(null, doc); }}");
Requirements
------------
View
4 src/test/com/fourspaces/couchdb/test/ViewTest.java
@@ -65,7 +65,7 @@ public void addNamed() throws Exception {
Document d2 = new Document();
//d2.put("foo","baz");
// d2.addView("all_documents", "function (doc){ return doc; }");
- d2.addView("viewfoobar", "testview", "function (doc){ if (doc.foo=='bar'){ return doc; }}");
+ d2.addView("viewfoobar", "testview", "function (doc){ if (doc.foo=='bar'){ emit(null, doc); }}");
log.debug("Saving d2 - "+d2.getId()+" - "+d2.toString());
foo.saveDocument(d2);
log.debug("Saved d2 - "+d2.getId()+" - "+d2.toString());
@@ -89,4 +89,4 @@ public void addNamed() throws Exception {
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.