Limit=-1still return 100 results

As I know strapi by default limit for results is 100 .Tried to use limit =-1 but it didn’t work for my rest api.What could be the problem ?

Problem solved , added _limit =-1 in find controllers function :slight_smile:

2 Likes

How?

My controller is just:

'use strict';

/**
 *  billing controller
 */

const { createCoreController } = require('@strapi/strapi').factories;

module.exports = createCoreController('api::billing.billing');

in case that anyone is looking for a full solution. This one works. Strapi v3.
//////////// stick below code into services.js to extend your controller functionality:

‘use strict’;

const _ = require(‘lodash’);

module.exports = {
async find(params, populate) {
const results = await strapi.query(‘restaurant’).find({ …params, _limit: -1 }, populate);
return results;
},
};