Couchbase

Qualified Name Type Release

apoc.couchbase.get

- retrieves a couchbase json document by its unique ID.

Procedure

APOC Full

apoc.couchbase.exists

- check whether a couchbase json document with the given ID does exist.

Procedure

APOC Full

apoc.couchbase.upsert

- insert or overwrite a couchbase json document with its unique ID.

Procedure

APOC Full

apoc.couchbase.append

- append a couchbase json document to an existing one.

Procedure

APOC Full

apoc.couchbase.prepend

- prepend a couchbase json document to an existing one.

Procedure

APOC Full

apoc.couchbase.remove

- remove the couchbase json document identified by its unique ID.

Procedure

APOC Full

apoc.couchbase.replace

- replace the content of the couchbase json document identified by its unique ID.

Procedure

APOC Full

apoc.couchbase.query

- executes a plain un-parameterized N1QL statement.

Procedure

APOC Full

Copy these jars into the plugins directory:

(Tested with CB Enterprise 5.5.3, note that CB 6 is not yet supported)

mvn dependency:copy-dependencies
cp target/dependency/java-client-2.5.9.jar target/dependency/core-io-1.5.2.jar target/dependency/rxjava-1.3.8.jar $NEO4J_HOME/plugins/

To interact with Couchbase you can define the host on which to connect to as the first parameter of the procedure (with bucket as second parameter, document_id as third parameter):

CALL apoc.couchbase.get('couchbase://Administrator:password@localhost', 'default', 'artist:vincent_van_gogh')

Otherwise you can use configuration properties in the same way as MongoDB. For example, you can add the following properties to the apoc.conf file:

apoc.couchbase.mykey.username=Administrator
apoc.couchbase.mykey.password=password
apoc.couchbase.mykey.uri=host1,host2,host3 // here you can define more than one hostname if you're using a cluster
apoc.couchbase.mykey.port=8091 // the bootstrapHttpDirectPort (optional)
CALL apoc.couchbase.get('mykey', 'default', 'artist:vincent_van_gogh')

You can also define some CouchbaseEnvironment parameters in the apoc.conf:

apoc.couchbase.connectTimeout=<default=5000>
apoc.couchbase.kvTimeout=<default=2500>
apoc.couchbase.ioPoolSize=<default=3>

In order to get an in-depth description of these configuration params please refer to the Official Couchbase Documentation