Last active
November 16, 2017 05:30
-
-
Save r3-yamauchi/3f1c3fd152959185be783b1321f01173 to your computer and use it in GitHub Desktop.
kintone のデータを Elasticsearch に入れて検索する https://blog.r3it.com/elasticsearch-firststep-88f58f0061d7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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