Skip to content

Instantly share code, notes, and snippets.

@r3-yamauchi
Last active November 16, 2017 05:30
Show Gist options
  • Save r3-yamauchi/3f1c3fd152959185be783b1321f01173 to your computer and use it in GitHub Desktop.
Save r3-yamauchi/3f1c3fd152959185be783b1321f01173 to your computer and use it in GitHub Desktop.
kintone のデータを Elasticsearch に入れて検索する https://blog.r3it.com/elasticsearch-firststep-88f58f0061d7
const util = require("./QueryKintoneRecords");
const fs = require("fs");
const env = JSON.parse(fs.readFileSync("./config/env.json"));
const queryKintoneRecords = new util.QueryKintoneRecords(env.domain, env.appId, env.apiToken);
const filepath = "./output/output.json";
describe("JSON出力", function () {
it("kintoneから取得・ファイル書き込み", function (done) {
this.timeout(1000 * 60 * 30); // 30 minutes
queryKintoneRecords.queryRecords()
.then(data => {
return new Promise((resolve, reject) => {
fs.writeFileSync(filepath, JSON.stringify(data, null, 2));
done();
resolve();
});
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment