Search code examples
restapiresponsestronglooploopback

Strongloop API response limit over Oracle Database


I've just started using Strongloop to define a REST api over my oracle database.

Everything works fine when I check my API using "localhost:3000/explorer".

For instance, when I send a "get" to list all persons, the server answers with the list of people in the PERSONS table. The issue is that the server does not return all the records in the table. It returns a 100 records only, knowing that the table contains more than a 100 records.

Am I missing something?


Solution

  • I found the solution, in case someone faces the same issue.

    The problem is that in loopback-connector-oracle, the maximum number of rows is set to 100.

    To change the maximum rows you should :

    1- In "datasources.json" file, set the property "maxRows" to the number you want, for instance "maxRows":1000

    2- Replace the file \node_modules\loopback-connector-oracle\lib\oracle.js with the file oracle.js

    3- Restart your API, now it will return more than 100 records

    See this link for more details about the issue