Uploaded image for project: 'Couchbase C client library libcouchbase'
  1. Couchbase C client library libcouchbase
  2. CCBC-1480

cbc has undocumented arguments --scope and --collection



    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • tools
    • None
    • 1


      I noticed the 'cbc' (part of the libcouchbase so other tools will also suffer the same issue) doesn't have very good help yes it just works with the default scope/collection.

      I have a keyspace of bulk.data.source and want to use cbc to create a document.

      cbc create SampleDocument2 -V '{"a_key": "a_value"}' -U couchbase://localhost/bulk -u Administrator -P password --expiry=60

      The above works but of course by default writes the document to bulk._default._default which is not what I wanted (fine for 6.6.2 but not 7.0).

      I was trying to get it to work in 7.0 GA (with scope 'data' and collection 'source'), I took a long time to determine the needed options, the below does what I want.

      cbc create SampleDocument2 -V '{"a_key": "a_value"}' -U couchbase://localhost/bulk --scope=data --collection=source -u Administrator -P password --expiry=60

      However the options I needed like are not documented in the output of -h for help ** 

      --scope=data --collection=source

      As can be seen below there is no information on how to set a scope and a collection both of the options for -scope and -collection are undocumented:


      cbc create -h
      Option h requires argument
       create [OPTIONS...] KEY -V VALUE
      Store item to the server
       -P --password Bucket password [Default='']
       -u --username Username [Default='']
       -Z --config-cache Path to cached configuration [Default='']
       -U --spec Connection string [Default='couchbase://localhost/default']
       --truststorepath [Default='']
       --certpath Path to server SSL certificate [Default='']
       --keypath Path to client SSL private key [Default='']
       -T --timings Enable command timings [Default=FALSE]
       -v --verbose Set debugging output (specify multiple times for greater verbosity [Default=FALSE]
       --dump Dump verbose internal state after operations are done [Default=FALSE]
       -y --compress Turn on compression of outgoing data (second time to force compression) [Default=FALSE]
       -D --cparam <OPTION=VALUE> Additional options for connection. Use -Dtimeout=SECONDS for KV operation timeout [Default=]
       -M --mode <upsert|insert|replace> Mode to use when storing [Default='upsert']
       -f --flags Flags for item [Default=0]
       -e --expiry Expiry for item [Default=0]
       -p --persist-to Wait until item is persisted to this number of nodes [Default=0]
       -r --replicate-to Wait until item is replicated to this number of nodes [Default=0]
       -V --value Value to use. If unspecified, read from standard input [Default='']
       -J --json Indicate to the server that this item is JSON [Default=FALSE]
       --scope Name of the collection scope [Default='_default']
       --collection Name of the collection [Default='']
       -d --durability Durability level [Default='none']
       -? --help this message



        Issue Links

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



              ray.cardillo Ray Cardillo
              jon.strabala Jon Strabala
              0 Vote for this issue
              5 Start watching this issue



                Gerrit Reviews

                  There are no open Gerrit changes