Skip navigation links

Couchbase Java SDK (2.4.1)

Welcome to the Couchbase Java SDK API Reference!

See: Description

Package Description
Clauses are mini-DSL that can help you produce a well-formed Expression for specific parts of some N1QL statement, aka clauses.
Functions are Expressions that represent predefined utility functions in N1QL.  

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

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

Skip navigation links

Copyright © 2015 Couchbase, Inc.