Couchbase
|
Retrieves a couchbase json document by its unique ID |
|
Check whether a couchbase json document with the given ID does exist |
|
Insert a couchbase json document with its unique ID |
|
Insert or overwrite a couchbase json document with its unique ID |
|
Append a couchbase json document to an existing one |
|
Prepend a couchbase json document to an existing one |
|
Remove the couchbase json document identified by its unique ID |
|
Replace the content of the couchbase json document identified by its unique ID. |
|
Executes a plain un-parameterized N1QL statement. |
|
Executes a N1QL statement with positional parameters. |
|
Executes a N1QL statement with named parameters. |
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.socketConnectTimeout=<default=1500> apoc.couchbase.kvTimeout=<default=2500> apoc.couchbase.ioPoolSize=<default=3> apoc.couchbase.computationPoolSize=<default=3>
In order to get an in-depth description of these configuration params please refer to the Official Couchbase Documentation