Export with cbexport ignores --scope-field and --collection-field

hello,
i’m trying to export parts of documents from a bucket by specifying --scope-field and --collection-field but it seems that the cbexport tool is exporting entire content of the bucket :

./cbexport json --cluster couchbases://*****.cloud.couchbase.com --username admin --password ‘*******’ --bucket nameofbucket --format lines --output travel-sample-export.json --scope-field tenant_agent_00 --collection-field users --include-key doc_key --no-ssl-verify
Documents exported: 122075 Documents skipped: 0
in that collection from that scope there are only 2 documents.
Have any one of you met this issue? I’m using capella 7.6.2

Use the --include-data or --exclude-data options to only export specific collections. cbexport json | Couchbase Docs

scope-field and collection-field are to add scope and collection fields in the export.

thanks a lot for reply,
without those the cbexport is showing errors:

./cbexport json --cluster couchbases://cb.****.cloud.couchbase.com --username admin --password ****** --bucket travel-sample --format lines --output users.csv --include-data tennant_agen_04.users --no-ssl-verify

JSON export failed: exporting from a collection aware cluster requires the ‘–scope-field’ and ‘–collection-field’ flags to be provided

Use the *-field options as well.

yes, that did the trick, together with include-data, thanks again, appreciated the time for reply

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.