I'm new to the Salesforce community, so I apologize if this question is asked wrong.
I was running into essentially the exact same problem mentioned in this post. Basically, I have a query that exceeds 2000 records. The answerer says I should use the function queryMore.
However, one of my co-workers suggested that I could get around this by using the BULK api. The BULK Api seems to work and I'm able to successfully retrieve all 32000 records in our database. I guess I'm wondering if there is a reason to be cautious with the BULK api. It seems the accepted solution to my problem is to use queryMore.
My Use Case
I am creating a RESTful service that returns the Salesforce data on-demand. I would store the Salesforce data locally, and I would update on some regular interval. Written using Node.js with jsforce, this is what it might look like.
function update_progress() {
jsforce-conn.query(progress_query, function (err, result) {
if (err) {
return console.error(err);
}
apidata.progress = result;
});
}
// http://localhost:4001/progress
express-app.get('/progress', (req, res) => {
res.setHeader('Content-Type', 'application/json');
res.send(apidata.sf.progress.records);
});
Note that I'm not doing anything with files. Rather I'm storing all the queried information inside of a node server.
My question
Should I use Bulk? Or would it be better to use SOQL queries with a for-loop or queryMore?