Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-36769

add an ability to print results only in cbq

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 7.1.0
    • 5.5.5, 6.0.3
    • query
    • None

    Description

       

      It would be very useful to have an ability to print in the cbq tool only the results of the request for scripting purposes. without the metadata of the request. especially in places jq tool is not available.

      for example currently this line, takes a query from a file, and print the results to another file, quietly

      /opt/couchbase/bin/cbq -e http://hostname:8091 -q -u username -pretty=false -l cbq_log.txt -f query.n1ql -o cbq_out.txt

       

      resutls are printed as follows:

       

      {
      "requestID": "0b965c25-ff59-49ca-9362-67a563cf4dae",
      "signature": {"address":"json","name":"json"},
      "results": [
      {...},
      {...}
      ],
      "status": "success",
      "metrics": {"elapsedTime": "18.079943038s","executionTime": "18.07984059s","resultCount": 10,"resultSize": 688}
      }
      

       

       

      instead of maybe just the array of the resutls,

      which would run as a command

      /opt/couchbase/bin/cbq -e http://hostname:8091-q -u username -pretty=false -nometa=true -l cbq_log.txt -f query.n1ql -o cbq_out.txt

       

      [
      {...},
      {...}
      ]
      

       

       

      Roi.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              pierre.regazzoni Pierre Regazzoni
              roi.katz Roi Katz
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty