I am calling 1000 records a time using for loop from a database using API (paging through data) and want that if the database record reaches its limit, the loop should terminate.
I am using limit and offset in url but i failed to stop at last record instead it start appending record from first unless loop terminates.
Note: range end is unknown.