Skip navigation links

Couchbase Java SDK (2.2.0)

Welcome to the Couchbase Java SDK API Reference!

See: Description

Packages 
Package Description
com.couchbase.client.java  
com.couchbase.client.java.bucket  
com.couchbase.client.java.cluster  
com.couchbase.client.java.document  
com.couchbase.client.java.document.json  
com.couchbase.client.java.env  
com.couchbase.client.java.error  
com.couchbase.client.java.event.consumers  
com.couchbase.client.java.query  
com.couchbase.client.java.query.consistency  
com.couchbase.client.java.query.core  
com.couchbase.client.java.query.dsl  
com.couchbase.client.java.query.dsl.element  
com.couchbase.client.java.query.dsl.functions  
com.couchbase.client.java.query.dsl.path  
com.couchbase.client.java.query.dsl.path.index  
com.couchbase.client.java.repository  
com.couchbase.client.java.repository.annotation  
com.couchbase.client.java.repository.mapping  
com.couchbase.client.java.transcoder  
com.couchbase.client.java.util  
com.couchbase.client.java.util.features  
com.couchbase.client.java.util.retry  
com.couchbase.client.java.view  

Welcome to the Couchbase Java SDK API Reference!

Here is a simple hello world that you can run and verify your installation works:

// Connect to a cluster on localhost
Cluster cluster = CouchbaseCluster.create();

// Open the default bucket
Bucket bucket = cluster.openBucket();

// Create a user and insert it
JsonObject user = JsonObject.empty()
    .put("firstname", "Walter")
    .put("lastname", "White")
    .put("job", "chemistry teacher")
    .put("age", 50);
JsonDocument doc = JsonDocument.create("walter", user);
JsonDocument response = bucket.upsert(doc);

// Read it back out
JsonDocument walter = bucket.get("walter");
System.out.println("Found: " + walter);

// Disconnect from the cluster
cluster.disconnect();

If you don't know where to go next, start at the CouchbaseCluster class!

Skip navigation links

Copyright © 2014 Couchbase, Inc.