Created
May 17, 2017 10:25
-
-
Save iendjinn/2e347d5bea7b5b3cd0fd3083afc928ef to your computer and use it in GitHub Desktop.
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 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