From 5f274713dc8f3b592fc6f49076e919ad8b78a038 Mon Sep 17 00:00:00 2001 From: Avi Aryan Date: Fri, 14 Jul 2017 13:53:22 +0530 Subject: [PATCH] add json adaptor docs --- docs/importer/adaptors/json.md | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 docs/importer/adaptors/json.md diff --git a/docs/importer/adaptors/json.md b/docs/importer/adaptors/json.md new file mode 100644 index 0000000..2e64900 --- /dev/null +++ b/docs/importer/adaptors/json.md @@ -0,0 +1,45 @@ +# JSON adaptor + +The json adaptor reads data from a json file. + +Here is how a configuration file looks like- + +```ini +src.type=json +src.uri=/full/path/to/file.json + +dest.type=elasticsearch +dest.uri=appname +``` + +The `file.json` should contain a json object with table namespaces as its keys. +The keys in return should contain an array containing the data that belongs to that namespace. + +Example - + +```js +{ + "pokemons": [ + { + "_id": 1, + "name": "Raichu" + }, + { + "_id": 1, + "name": "Bulbasaur" + } + ], + "bitbeasts": [ + { + "_id": 1, + "name": "Dragoon", + "owner": "Tyson" + }, + { + "_id": 2, + "name": "Dranzer", + "owner": "Kai" + } + ] +} +``` -- GitLab