Name Date Size

..11-Feb-20204 KiB

.gitignoreH A D11-Feb-2020205

beer-sample.zipH A D11-Feb-20203.3 MiB

cbdocloaderH A D11-Feb-20207.3 KiB

CMakeLists.txtH A D11-Feb-2020514

gamesim-sample.zipH A D11-Feb-2020210.6 KiB

generate-travel-sample.rbH A D11-Feb-202016.6 KiB

LICENSEH A D11-Feb-202038.2 KiB

README.mdH A D11-Feb-20202.8 KiB

travel-sample.zipH A D11-Feb-202018.6 MiB

wrapper/H11-Feb-20204 KiB

README.md

1Docloader
2=============
3
4We use this tool to upload a bunch of json documents into Couchbase Server.
5
6Build
7-------
8
9After you clone the project from `git@github.com:couchbase/couchbase-examples.git`, run the following command:
10
11    config/autorun.sh
12
13To build the package, run
14
15    make bdist
16
17Run command
18------------
19
20    cbdocloader OPTIONS DOCUMENTS
21
22DOCUMENTS:
23
24The documents parameter can be either a directory name which contains all the json documents or a .zip file which archives the document directory.
25
26Generally speaking, the document directory should have the following layout:
27
28    /design_docs    which contains all the design docs for views.
29    /docs           which contains all the raw json data files. It can have other sub directories too.
30
31All json files should be well formatted. And no spaces allowed in file names. Design docs will be uploaded after all other data files.
32
33OPTIONS:
34
35  `-n HOST[:PORT]`, --node=HOST[:PORT] Default port is 8091
36
37  `-u USERNAME`, --user=USERNAME       REST username of the cluster. It can be specified in environment variable REST_USERNAME.
38
39  `-p PASSWORD`, --password=PASSWORD   REST password of the cluster. It can be specified in environment variable REST_PASSWORD.
40
41  `-b BUCKETNAME`, --bucket=BUCKETNAME Specific bucket name. Default is default bucket. Bucket will be created if it doesn't exist.
42
43  `-s QUOTA`,                          RAM quota for the bucket. Unit is MB. Default is 100MB.
44
45  `-h` --help                          Show this help message and exit
46
47Example
48-------
49
50    # Upload documents archived in zip file ../samples/gamesim.zip. All data will be inserted in bucket mybucket
51    #
52    ./cbdocloader  -n localhost:8091 -u Administrator -p password -b mybucket ../samples/gamesim.zip
53
54Errors
55------
56
57These are kinds of error cases to consider ...
58
59* JSON files are not well formatted
60* Wrong REST username and password
61* Bucket cannot be created due to too large ram quota specified.
62
63Licenses
64--------
65
66### Beer sample
67
68To quote from the original [Open Beer Database](http://openbeerdb.com/):
69
70    This Open Beer Database is made available under the Open Database License:
71    http://opendatacommons.org/licenses/odbl/1.0/. Any rights in individual
72    contents of the database are licensed under the Database Contents License:
73    http://opendatacommons.org/licenses/dbcl/1.0/
74
75The data was converted to JSON with the [scripts from Sergey Avseyev](https://github.com/avsej/beer-sample).
76
77### Gamesim sample
78
79The gamesim sample is licensed under the Apache License 2.0.
80
81### Travel sample
82
83Landmarks converted to JSON from CSV dump of [english version of wikivoyage][wikivoyage].
84Licensed under [Creative Commons Attribution Share-Alike][cc-by-sa].
85
86[wikivoyage]: http://datahub.io/dataset/wikivoyage-listings-as-csv
87[cc-by-sa]: http://opendefinition.org/licenses/cc-by-sa/
88