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

cbimport/cbexport does not work on single element JSON docs

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 6.5.0
    • 5.5.0
    • tools
    • None
    • Untriaged
    • Unknown

    Description

      Problem

      A single element JSON is a valid JSON document, unfortunately cbimport/cbexport does not support them. 'cbexport' ignores them altogether, and 'cbimport' throws an error when given them.

      Example of single Element JSON docs:

      5
      "raw string"
      ["array","of","raw","values",12345,true]
      true
      

      cbexport:

      /Applications/Couchbase\ Server.app/Contents/Resources/couchbase-core/bin/cbexport  json -c localhost -u Administrator -p password  -f lines  -o export  -b default
      2018-11-08T14:38:20.737+00:00 WARN: Value of key `<ud>array</ud>` is not valid json, skipping -- jsondata.(*jsonLineCallbacks).Mutation() at lines_exporter.go:61
      2018-11-08T14:38:20.738+00:00 WARN: Value of key `<ud>number</ud>` is not valid json, skipping -- jsondata.(*jsonLineCallbacks).Mutation() at lines_exporter.go:61
      2018-11-08T14:38:20.738+00:00 WARN: Value of key `<ud>string</ud>` is not valid json, skipping -- jsondata.(*jsonLineCallbacks).Mutation() at lines_exporter.go:61
      

      Step to reproduce

      1. Create a single element JSON doc in the document editor in the UI
      2. Use cbexport
      1. Create a single element JSON doc in the JSON list/line file
      2. Use cbimport with the file created above

      (Should check that the document is getting tagged as JSON by the Data service)

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-30734
          # Subject Branch Project Status CR V

          Activity

            People

              carlos.gonzalez Carlos Gonzalez Betancort (Inactive)
              eben Eben Haber
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty