couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Couchdb Wiki] Update of "Getting started with Java" by elbac
Date Wed, 25 Feb 2009 21:42:01 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification.

The following page has been changed by elbac:
http://wiki.apache.org/couchdb/Getting_started_with_Java

The comment on the change is:
fixed syntax

------------------------------------------------------------------------------
  
  Document newdoc = new Document();
  newdoc.put("foo","baz"); // same as JSON: { foo: "baz"; }
- db.saveDocument(newdoc); // auto-generated id given by the database
+ newdoc.saveDocument(newdoc); // auto-generated id given by the database
  
  // Running a view
- ViewResult result = db.getAllDocuments(); // same as db.view("_all_dbs");
+ ViewResults result = db.getAllDocuments(); // same as db.view("_all_dbs");
  for (Document d: result.getResults()) {
          System.out.println(d.getId());
  
@@ -57, +57 @@

  }
  
  // Ad-Hoc view
- ViewResult resultAdHoc = db.adhoc("function (doc) { if (doc.foo=='bar') { return doc; }}");
+ ViewResults resultAdHoc = db.adhoc("function (doc) { if (doc.foo=='bar') { return doc; }}");
  }}}
  
  == Older Libraries ==

Mime
View raw message