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

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • 3.2.7
    • tools
    • None
    • 1

    Description

      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
      Usage:
       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
      

       

      Attachments

        Issue Links

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

          Activity

            owend Daniel Owen added a comment -

            Hi Jon Strabala

            The cbc program is owned by the SDK team - therefore reassigning to Matt Ingenthron

            owend Daniel Owen added a comment - Hi Jon Strabala The cbc program is owned by the SDK team - therefore reassigning to Matt Ingenthron
            ingenthr Matt Ingenthron added a comment - - edited

            Thanks for the issue here Jon Strabala. A couple of quick notes…

            If you're using the cbc tools, the best way to acquire/use them is actually in the libcouchbase distribution. See the docs on that.

            The tools embedded in Couchbase Server are, because of the dependency nature, frequently older. The one in 7.0 is from the 3.1 line that didn't officially support scopes/collections, but we worked out the necessary features with the eventing team. 3.2 adds official support.

            It's not really a tool in Couchbase Server as much as it is there as an artifact of how the dependencies are built. There've been discussions of removing cbc, but there are arguments from some folks that it is very convenient to have them there.

            In any case, we should document the features.

            I'll also note that there's a ticket to the eventing team already to update to the latest lcb (which will bring in the latest tools) and there will be some other updates for Couchbase Server 7.0.2 and Neo.

            ingenthr Matt Ingenthron added a comment - - edited Thanks for the issue here Jon Strabala . A couple of quick notes… If you're using the cbc tools, the best way to acquire/use them is actually in the libcouchbase distribution. See the docs on that. The tools embedded in Couchbase Server are, because of the dependency nature, frequently older. The one in 7.0 is from the 3.1 line that didn't officially support scopes/collections, but we worked out the necessary features with the eventing team. 3.2 adds official support. It's not really a tool in Couchbase Server as much as it is there as an artifact of how the dependencies are built. There've been discussions of removing cbc, but there are arguments from some folks that it is very convenient to have them there. In any case, we should document the features. I'll also note that there's a ticket to the eventing team already to update to the latest lcb (which will bring in the latest tools) and there will be some other updates for Couchbase Server 7.0.2 and Neo.

            Ray Cardillo: can you triage this and figure out if we need to add this to help/man pages?

            ingenthr Matt Ingenthron added a comment - Ray Cardillo : can you triage this and figure out if we need to add this to help/man pages?
            ray.cardillo Ray Cardillo added a comment - - edited

            Matt Ingenthron (cc: Jon Strabala) After some investigation, and discussion with Sergey Avseyev, that implementation was only intended for cbc-pillowfight and was purposely undocumented and hidden.

            See the related comment for CCBC-878 in the release notes:

            Note that this change does not expose anything related to Collections API for libcouchbase. It defines hidden switches for pillowfight tool to allow benchmark of collections. The switches are not documented and might be removed in the future. Use with care.

            However, it looks like this has caused some confusion. I was able to find a few other issues that are related and asking for other changes (see issues linked in CCBC-1482). So I opened CCBC-1482 instead so we can review the related tickets, review the request for command line consistency with other utils, and provide a better implementation. We'll have to circle back around to this ticket and the related tickets after CCBC-1482 is resolved.

            ray.cardillo Ray Cardillo added a comment - - edited Matt Ingenthron (cc: Jon Strabala ) After some investigation, and discussion with Sergey Avseyev , that implementation was only intended for cbc-pillowfight and was purposely undocumented and hidden. See the related comment for CCBC-878 in the release notes : Note that this change does not expose anything related to Collections API for libcouchbase. It defines hidden switches for pillowfight tool to allow benchmark of collections. The switches are not documented and might be removed in the future. Use with care. However, it looks like this has caused some confusion. I was able to find a few other issues that are related and asking for other changes (see issues linked in CCBC-1482 ). So I opened CCBC-1482 instead so we can review the related tickets, review the request for command line consistency with other utils, and provide a better implementation. We'll have to circle back around to this ticket and the related tickets after CCBC-1482 is resolved.

            People

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

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty