So I’m making API for my application (currently Android). Problem is that I have a very large collection (about 10k entries) and when app make request to meteor app all the data is returned. What I need to do is to somehow return collection data in chunks for example client makes a request then server returns 20 entries (1-20) when second request is made server return other 20 entries (20-40) and so on… I can easily track number of entries that is in my client. So is is possible? I will add my code that returns all the data
"getNearestLocations": function(lng, lat) {
var myTest = Collections.Location.find({
location: {
$near: {
$geometry: {
type: 'Point',
coordinates: [lng, lat]
}
}
}
}).fetch();
console.log(myTest.length);
return myTest;
}