반응형

/*******************************************************************************************************************
-- Title : [Cb5.0] cbq 쉘과 웹콘솔을 사용한 결과 저장하기
-- Reference : couchbase.com
-- Key word : couchbase 카우치베이스 cbq shell cbq 쉘 웹콘솔 web console export redirect 리다이렉트 
*******************************************************************************************************************/

■ Docs : cbq 쉘 사용법
    o https://developer.couchbase.com/documentation/server/current/tools/cbq-shell.html


■ cbq 쉘을 사용한 결과 export
    o cbq 접속
        $ cd /opt/couchbase
        $ cd /bin
        
        $ ./cbq --engine http://localhost:8091 -u=Administrator

          Enter Password: 

          Connected to : http://localhost:8091/. Type Ctrl-D or \QUIT to exit.


          Path to history file for the shell : /home/couchbase/.cbq_history 
          cbq> 

    o REDIRECT를 통한 결과 저장
        cbq> \REDIRECT /mypath/result.out;

        cbq> select meta().id from mybucket limit 3;
        cbq> \REDIRECT OFF;

        $ cd /mypath
        $ cat result.out
        select raw meta().id from FTbk limit 3
        {
            "requestID": "8bcedb65-b80f-4fed-980d-eba5020ac800",
            "signature": "json",
            "results": [
                "KEY11111",
                "KEY22222",
                "KEY33333"
            ],
            "status": "success",
            "metrics": {
                "elapsedTime": "85.958004ms",
                "executionTime": "85.944991ms",
                "resultCount": 3,
                "resultSize": 51
            }
        }


■ 웹콘솔을 사용한 결과 export

    o 웹콘솔 > Query > EXPORT 클릭
    

    o 저장될 결과 | 쿼리 선택, 파일명 지정

    

    o 결과 확인

    


반응형

+ Recent posts