Need to import Excel spreadsheet into ONE document

I’ve been given an odd requirement to store an Excel spreadsheet in one JSON document within Couchbase. cbimport is saying that my document is not valid JSON, when it is, so I believe something else is wrong.

My document goes along the style of this:

[{ "sets": [
   {
      "cluster" : "M1M",
      "type" : "SET",
      "shortName" : "MARTIN MARIETTA MATERIALS",
      "clusterName" : "MARTIN MARIETTA",
      "setNum" : "10000163"
   },
   {
      "shortName" : "STERLING INC",
      "type" : "SET",
      "cluster" : "SJW",
      "setNum" : "10001427",
      "clusterName" : "STERLING JEWELERS"
   },
   ...
]}]

And my cbimport command looks like this:

cbimport json --cluster localhost --bucket documentBucket \
--dataset file://set_numbers.json --username Administrator \
--password password --format lines -e errors.log -l debug.log \
--generate-key 1

I’ve tried to format as lines as well as list. Both fail. What am I doing wrong?

Ah, I need to specify list instead of lines! It works now.

1 Like

I saw this question on SO first, so I answered it there: https://stackoverflow.com/questions/49989536/need-to-import-2m-of-json-into-one-couchbase-document