Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-45786

cbexport could easily filter on key prefix (or by regex)

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Duplicate
    • Major
    • None
    • Cheshire-Cat
    • tools
    • None
    • 1

    Description

      I answered a forum post (link) and wrote a simple archiving Eventing function

      function OnUpdate(doc, meta) {
          if (! meta.id.startsWith("doc-wigitcompany-")) return;
          dst_bkt[meta.id] = doc;
      }
      

      Then I used cbexport to extract my matched documents from a dedicated archive bucket.

      /opt/couchbase/bin/cbexport json -c couchbase://127.0.0.1 -u $CB_USERNAME -p $CB_PASSWORD -b archive -f lines -o /tmp/tmp.out.json

      It became apparent that a simple enhancement to the cbexport tool to allow it to filter by key prefix (or by regex) would allow me to skip the Eventing step I proposed in the forum post altogether.   

      Perhaps options like -m, --match_key_prefix and -r --match_regex_key could be added.  I am assuming that cbexport is a fast DCP consumer here.

       

      Attachments

        Issue Links

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

          Activity

            People

              owend Daniel Owen
              jon.strabala Jon Strabala
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty