-
Install (if not) Java 8 and Maven
-
Modify Couchbase Cache configuration in cache.properties
-
Move to couchbase-spring-cache directory and run
mvn spring-boot:runcommand - It build and deploy the project on default embedded Tomcat server running on port9901 -
Get employee from Couchbase Cache as
http://localhost:9901/employee/get
-
Databases Path -
/Users/ArpitAggarwal/Library/Application Support/Couchbase/var/lib/couchbase/data -
Indexes Path -
/Users/ArpitAggarwal/Library/Application Support/Couchbase/var/lib/couchbase/data -
hostname - 127.0.0.1
-
username - Administrator
-
password - password
If the first one in the list fails the other ones can be tried. After initial contact is made, the bootstrap list provided by the user is thrown away and replaced with a list provided by the server (which contains all nodes of the cluster).
List<String> nodes = Arrays.asList("192.168.56.101", "192.168.56.102");
Cluster cluster = CouchbaseCluster.create(nodes);
CREATE PRIMARY INDEX `default-primary-index` ON `default` USING GSI;
SELECT * FROM system:indexes WHERE name="default-primary-index";
http://127.0.0.1:8092/bucket_name/_design/cache/_view/view_name?connection_timeout=60000&inclusive_end=true&limit=1000&skip=0&stale=false
It provides a rich graphical user interface to prepare and execute simple to complex N1QL queries, you can found tutorial to learn N1QL queries here - http://query.pub.couchbase.com/tutorial/#1
Sources: