a.txt file content
\set -pretty false;
\set -metrics false;
\set -signature false;
\REDIRECT a.txt.out;
SELECT d.* FROM default AS d;
RUN : cbq -e=127.0.0.1:8093 -u=Administrator -p=password -file a.txt
Content of a.txt.out
SELECT d.* FROM default AS d
{
"requestID": "ecfec711-94c3-4750-b5fb-73864abc6b6a",
"results": [
{"id":"123456","name":"abc","skills":[{"level":"expert","skill_id":"SK01","skill_name":"Java"},{"level":"intermediate","skill_id":"SK01","skill_name":"Java"},{"level":"intermediate","skill_id":"SK02","skill_name":"c++"}]},
{"id":"554432","name":"cde","skills":[{"level":"expert","skill_id":"SK01","skill_name":"Java"},{"level":"intermediate","skill_id":"SK02","skill_name":"c++"},{"level":"intermediate","skill_id":"SK02","skill_name":"c++"}]},
{"id":"6789076","name":"cdef","skills":[{"level":"expert","skill_id":"SK01","skill_name":"Java"},{"level":"intermediate","skill_id":"SK02","skill_name":"c++"},{"level":"intermediate","skill_id":"SK03","skill_name":"php"}]}
],
"status": "success"
}
edit a.txt.out
Replace first 4lines with [
Last 3 lines with ]
[
{"id":"123456","name":"abc","skills":[{"level":"expert","skill_id":"SK01","skill_name":"Java"},{"level":"intermediate","skill_id":"SK01","skill_name":"Java"},{"level":"intermediate","skill_id":"SK02","skill_name":"c++"}]},
{"id":"554432","name":"cde","skills":[{"level":"expert","skill_id":"SK01","skill_name":"Java"},{"level":"intermediate","skill_id":"SK02","skill_name":"c++"},{"level":"intermediate","skill_id":"SK02","skill_name":"c++"}]},
{"id":"6789076","name":"cdef","skills":[{"level":"expert","skill_id":"SK01","skill_name":"Java"},{"level":"intermediate","skill_id":"SK02","skill_name":"c++"},{"level":"intermediate","skill_id":"SK03","skill_name":"php"}]}
]
now use cbexport with list format cbexport json | Couchbase Docs
cbexport json -c couchbase://127.0.0.1 -u Administrator -p password -b default -o a.txt.out -f list