I am trying to understand how I can use jsforce & bulk query to export 50k records from salesforce. Only the first 10k is returned, I understand that this is due to a batch size limit of 10k however I don't understand how to create the next batch to get records 10001 through 20000 and so on.
Currently, I have the following, any help would be much appreciated.
conn.bulk.query('SELECT Id FROM Account')
.on('record', function record(rec) {
log.debug('dumpAllObject', 'rec', rec);
})
.on('error', function handle(err) { log.error('dumpAllObject', 'error', err); })
.on('end', function resolve() {
log.info('dumpAllObject', 'Completed');
});