A newer version of this documentation is available.

View Latest

N1QL error

    +

    A N1QL error happens when there is an error processing the N1QL statement in a request:

    Request:
    $ curl -v http://localhost:8093/query/service \
    -d "statement=SLECT text FROM tweets LIMIT 1"
    Response:
         < HTTP/1.1 400 Bad Request
         {
         "requestID": "922edd9a-23d7-4053-8d60-91f7cbc22c83",
         "errors": [
         {
         "code": <int>,
         "msg": "Syntax error at token: SLECT"
         }],
         "status": "fatal",
         "metrics": {
         "elapsedTime": "134.7944us",
         "executionTime": "130.5518us",
         "resultCount": 0,
         "resultSize": 0,
         "mutationCount": 0,
         "errorCount": 1,
         "warningCount": 0
         }
         }
         $
    Request:
    $ curl -v http://localhost:8093/query/service \
    -d "statement=SELECT text FROM weets LIMIT 1"
    Response:
         < HTTP/1.1 404 Not Found
         {
         "request_id": "2ac080ba-6419-4905-a20b-c881966b6402",
         "errors": [
         {
         "code": <int>,
         "msg": "Keyspace weets does not exist"
         }],
         "status": "fatal",
         "metrics": {
         "elapsedTime": "134.7944us",
         "executionTime": "130.5518us",
         "resultCount": 0,
         "resultSize": 0,
         "mutationCount": 0,
         "errorCount": 1,
         "warningCount": 0
         }
         }
         $