Couchbase N1QL queries on the server

I used the online N1QL Tutorial to practice writing queries. Now that I have my own couchbase server, I want to request my own data.

My questions

Where on the Couchbase server can I write my queries?

thank

+4
source share
3 answers

Remember that N1Q1 is still in beta.

How it works, you need to run the Couchbase Query Server (aka CBQ). It runs on port 8093 by default (see N1QL ). The query server connects to the specified Couchbase instance / cluster. eg

cbq-engine -couchbase <CB-location>

CB Query Engine , N1QL, :

cbq -engine http://your-cb-host:8093/

cbq> SELECT 'Hello World' AS Greeting
{
    "resultset": [
        {
            "Greeting": "Hello World"
        }
    ],
    "info": [
        {
            "caller": "http_response:160",
            "code": 100,
            "key": "total_rows",
            "message": "1"
        },
        {
            "caller": "http_response:162",
            "code": 101,
            "key": "total_elapsed_time",
            "message": "4.0002ms"
        }
    ]
}
+4
+1

, N1QL (http://docs.couchbase.com/developer/n1ql-dp3/n1ql-intro.html) Couchbase , 1697575; :

cbq-engine -datastore <CB-location>

Couchbase N1QL , :

cbq-engine -datastore=dir:./data
0

All Articles