I have this code inside my FOXX play application
var geodata = new Geodata(
applicationContext.collection('geodata'),
{model: Geodatum}
);
/** Lists of all geodata.
*
* This function simply returns the list of all Geodatum.
*/
controller.get('/', function (req, res) {
var parameters = req.parameters;
var limit = parameters['limit'];
var result = geodata.all().limit(10);
if (limit != "undefined") {
result = result.slice(0, limit);
}
res.json(_.map(result, function (model) {
return model.forClient();
}));
});
According to the docs I should be able to use pagination here - I want to limit the search results by the given 'limit' parameter but this gives me an error
2016-05-16T14:17:58Z [6354] ERROR TypeError: geodata.all(...).limit is not a function