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

cbimport: support key generators with nested field path

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Critical
    • 6.5.0
    • None
    • tools

    Description

      Currently it is not possible to generate a key from json path, only first level properties.

      The following example do not work:

      i.e.

      document

      \{
       
        “sub”: \{
       
              “id”:1234
       
        }
       
      }
      

       

      /opt/couchbase/bin/cbimport json -c cluster -u Administrator -p password -b bucket -f lines -d file:///home/user/test.json -g %sub.id%
      

      We need to support it so it would support more use cases.

       
      I’m getting an error:

      2018-03-19T11:12:47.924+02:00 ERRO: Key generation for document failed, field with sub.id does not exist in document -- jsondata.(*Parallelizer).Execute.func1() at source.go:187
      

       

      It is working if the key is flat on the first level.

      Attachments

        Issue Links

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

          Activity

            People

              thuan Thuan Nguyen
              roi.katz Roi Katz
              Votes:
              1 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty