Example Spring Boot app which integrates with a Couchbase NoSQL Database using Spring Data Couchbase.
A couchbase test server configured according to is required in order to run the integration tests. Instructions to set up such a server are provided in Docker Couchbase Test Server.
$ ./gradlew integrationTest-
spin up container
docker run -d --name db -p 8091-8094:8091-8094 -p 11210:11210 couchbase:6.0.0
-
Visit http://localhost:8091 on the host machine to see the Web Console
-
Walk through the Setup wizard and accept the default values.
- You may need to disable analytics if the defaults won't run in your environment.
-
Add a
carsbucket with default settings. -
Navigate to
Security -> Add Userto create a new user calledcars, with passwordpassword, andApplication Accesspermissions oncarsbucket. -
Create index
Go to
Queryand run the following. This isn't strictly necessary due to our use oforg.springframework.data.couchbase.core.query.N1qlPrimaryIndexedCREATE PRIMARY INDEX ON cars USING GSI;
For further information on the couchbase container, see dockerhub.com/couchbase.