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:40:45 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

------------------------------------------------------------------------------
  
  Document doc = db.getDocument("documentid1234");
  doc.put("foo","bar");
- db.save(doc);
+ db.saveDocument(doc);
  
  Document newdoc = new Document();
- doc.put("foo","baz"); // same as JSON: { foo: "baz"; }
+ newdoc.put("foo","baz"); // same as JSON: { foo: "baz"; }
- db.save(doc); // auto-generated id given by the database
+ db.saveDocument(newdoc); // auto-generated id given by the database
  
  // Running a view
  ViewResult result = db.getAllDocuments(); // same as db.view("_all_dbs");

Mime
View raw message