Skip to content

Instantly share code, notes, and snippets.

@iendjinn
Created May 17, 2017 10:25
Show Gist options
  • Save iendjinn/2e347d5bea7b5b3cd0fd3083afc928ef to your computer and use it in GitHub Desktop.
Save iendjinn/2e347d5bea7b5b3cd0fd3083afc928ef to your computer and use it in GitHub Desktop.
const databot = function(input, output, context) {
const api = context.tdxApi;
let x = 0;
api.getNDDatasetData(
"HygXQFrwx-", // This contains nearly 6 million documents
null,
null,
{limit: 0}
)
.pipe(split(JSON.parse, null, {trailing: true}))
.on("data", (data) => {
console.log(x);
x++;
})
.on("end", () => {
console.log("done");
})
.on("error", (err) => {
console.log(err);
});
}
// output
...
498204
498205
498206
498207
498208
498209
498210
498211
498212
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment