Command Line Tools
Starting and Stopping Analytics
- On Linux and Mac OS X systems:
cd cbas ./samples/local/bin/start-sample-cluster.sh ./samples/local/bin/stop-sample-cluster.sh
- On Windows systems:
cd cbas .\samples\local\bin\start-sample.cluster.bat .\samples\local\bin\stop-sample-cluster.bat
Running the cbq
The cbq is the command line shell for executing queries against Couchbase Server. Analytics contains a special version of cbq that works with the analytics service and can execute multi-line statements. Make sure you use the version of cbq located in your Analytics install folder.
If you’re running Analytics on Docker, execute cbq using the following command:
docker exec -it analytics cbqThe cbq tool enables you to run N1QL queries from the command line.
The base syntax is:
cbq> create primary index on 'beer-sample'; cbq> select * from 'beer-sample' limit 1;