Reputation: 51
As i have created a data file in JSON format and I want to know how to load that JSON file to existing Couchbase Server bucket through command line or manually?
Upvotes: 2
Views: 1951
Reputation: 26169
To add it manually, you can simply copy and paste the contents into the UI.
Go to Buckets -> click "Documents" next to the bucket you want -> click "Add Document" on the top right.
First, enter whatever key you want. Next, paste the JSON contents.
Upvotes: 1
Reputation: 26169
There is a cbimport command line tool that ships with Couchbase Server that you can use to import JSON (or CSV) data.
Here's an example that imports a JSON "lines" file into localhost and generates a UUID key
$ cbimport json -c couchbase://localhost -u myusername -p mypassword \
-b mybucket -d file:///data/myjson.json -f lines -g #UUID#
Upvotes: 2