Kishan Mishra
Kishan Mishra

Reputation: 169

Exporting data using CouchbaseCLI cbexport error

I tried following the documentation and used the following command for fetching the data from the travel-sample bucket in the JSON format

Command : C:\Program Files\Couchbase\Server\bin>cbexport json -c couchbase://127.0.0.1 -u Administrator -p uity790 -b travel-sample -o F:/travel-sample.json -f lines -t 4

But I am constantly getting this error "JSON export failed: failed to get export transferable: exporting from a collection aware cluster requires scope/collection fields to be provided"

What is the correct way of doing that using the CLI on windows?

Upvotes: 1

Views: 1919

Answers (1)

Matthew Groves
Matthew Groves

Reputation: 26151

Per the 7.0 documentation on cbexport-json:

--scope-field <scope_field> When exporting from a collection aware cluster this field will be created in each JSON document; it will be used to store the name of the scope the document came from.

--collection-field <collection_field> When exporting from a collection aware cluster this field will be created in each JSON document; it will be used to store the name of the collection the document came from.

So it seems like you need to specify those arguments as well. Something like:

--scope-field couchbaseScope --collection-field couchbaseCollection

Upvotes: 2

Related Questions