Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

GET method returns up to 100 records only

Hi,

I'm using Oracle DB to store data from Appery DB. So far, I manage to perform, PUT and POST methods successfully. However, I'm struggling with GET and DELETE as follows:

1) GET:
I use the following request:
pre l_http_request := UTL_HTTP.begin_request('https://api.appery.io/rest/1/db/collections/Outlets_Details'
, 'GET'
, 'HTTP/1.1');

-- ...set header's attributes
UTL_HTTP.set_header(l_http_request, 'X-Appery-Database-Id', '53f2dac5e4b02cca64021dbe');

-- get Response and obtain received value
l_http_response := UTL_HTTP.get_response(l_http_request); /pre

Which works like charm in the sense that it does read Appery collection, but only up to 100 records. I only noticed that after I used bigger collections ( I tried several collections) and it always stops at the the record 100.

Is their any restriction on GET like this? and how to solve it?

2) DELETE:
I need to use 'DELETE' method to delete all records in normal collection (not users). However, my request works only when I provide _id value:

pre
url VARCHAR2(4000) := 'https://api.appery.io/rest/1/db/collections/Test_Member_Points_Details/54b6437fe4b04a26676ce472
/pre

Is there anyway to delete without providing _id (e.g. using wildcard)? Or the only way to use 'GET' first to collect all_id's and then use 'DELETE' ?

Many thanks,

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

GET method returns up to 100 records only

Hi Hawk,

Yes that's default limit. You can change it with "limit" parameter.

You can read more here::

http://devcenter.appery.io/documentat...

Details: http://prntscr.com/5uov77/direct

Regards.

Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

GET method returns up to 100 records only

Many thanks Yurii,

1) I tried to include this parameter

pre
https://api.appery.io/rest/1/db/collections/Outlet_Details?limit={"data-urlencode": "2000"}
/pre
as follows:

pre
https://api.appery.io/rest/1/db/collections/Outlet_Details?limit%3D%7B%22data-urlencode%22%3A%20%222000%22%7D
/pre

But it does not work. Is this the right way to use : limit ?

2) What about 'DELETE' issue?

Many thanks,

Ihor Didevych
Posts: 0
Joined: Wed Nov 19, 2014 7:55 pm

GET method returns up to 100 records only

Hawk,

1) No, it should be just limit = number_value
https://api.appery.io/rest/1/db/colle...

2) How then DB will know which entity to delete if you will not specify the _id?
So the answer is "no", you can't drop _id from the request

Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

GET method returns up to 100 records only

1) Is there any maximum value for 'limit'? (e.g. 1500)?

Thanks,

Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

GET method returns up to 100 records only

Alright, Now my dilemma is I have more than 3000 users, and I need to update their passwords and other details from Oracle DB.
If I run GET to fetch _id's and then run 'PUT' to update based on the their _id's, it will update only 1500. Next run, it will update the same 1500.
Even if I add another column in user's collection as "flag it as already updated", I cannot use it since "where" parameter is not allowed here (i.e. I cannot say update all records where flag = 0).

Is there any other way to manipulate Users collections?
Thanks,

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

GET method returns up to 100 records only

Then you can follow this:

1) Do not use limit in this case;
2) Get all users first and save ids to the array;
3) Set portion interval 0 - 1500 for instance;
4) Update portion of users;
5) On update complete increase portion;
6) back to #4.

Hawk
Posts: 0
Joined: Mon Aug 04, 2014 11:23 am

GET method returns up to 100 records only

Hi Illya,

2) How can I get all users id's if GET will return maximum 1500 records?
3) How to set portion interval ? Is this in GET or PUT request ?

Thanks,

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

GET method returns up to 100 records only

Hawk,

1) You can try to work with created_at field
or
2) Create a column that will work as a flag, whenever you updated user or not, or use updated_At field

Return to “Issues”