Jsforce: Data fetch get stuck for large datasets

Created on 9 Nov 2016  路  3Comments  路  Source: jsforce/jsforce

Hi there,

I am experiencing a problem fetching large datasets (roughly half million rows), my query looks a little like this:

conn
  .sobject('Account')
  .select('the,fields,I,need')
  .execute({ autoFetch: true, maxFetch: 1000000 })
  .on('record', (res) => console.log(res))
  .on('error', (err) => console.log(err))
  .on('end', () => console.log('all done'));

Not always, but more often than not, my callback stops being called and it never reaches the "on.('end')", neither it gives me any errors.

Is there something I am doing wrong?

Thanks

Most helpful comment

The issue was that I was inserting the results into my MongoDB, the writing process would take longer than the results received from SalesForce, I fixed the problem by pushing the results to an array first, then, when the process ends, insert the records into MongoDB.

All 3 comments

Correction, it did throw me an error this time, even though the same data set was imported before:

RangeError: Maximum call stack size exceeded

Correction, I no longer get the Maximum call stack error, the app just hangs, no response, no errors.

The issue was that I was inserting the results into my MongoDB, the writing process would take longer than the results received from SalesForce, I fixed the problem by pushing the results to an array first, then, when the process ends, insert the records into MongoDB.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

CodisRedding picture CodisRedding  路  4Comments

JonDum picture JonDum  路  7Comments

twojoke picture twojoke  路  5Comments

stomita picture stomita  路  5Comments

vivinRajagopalan picture vivinRajagopalan  路  6Comments