Couchbase Java SDK (2.7.20)

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();
    cluster.authenticate("username", "password");

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

    // 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!

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.