I am using this code presently. This can fetch more than 1000 results.
The values are sorted according to "objectId". You can sort according to "createdAt" by changing accordingly.
Final results are stored in result array
var result = [];
var processCallback = function(res) {
result = result.concat(res);
if (res.length == 1000) {
process(res[res.length-1].id);
return;
}
//To print all the ids
for(var i=0;i<result.length;i++){
console.log(result[i].id);
}
}
var process = function(skip) {
var query = new Parse.Query("ObjectName");
if (skip) {
query.greaterThan("objectId", skip);
}
query.limit(1000);
query.ascending("objectId");
query.find().then(function querySuccess(res) {
processCallback(res);
}, function queryFailed(error) {
});
}
process(false);