You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by Apache Wiki <wi...@apache.org> on 2009/02/25 22:40:45 UTC

[Couchdb Wiki] Update of "Getting started with Java" by elbac

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");