Page 1 of 1

Database Response without any Request

Posted: Sun Nov 02, 2014 4:18 pm
by Abhigyan Singh

I want to get a particular column value of the LAST row of the database collection and store it... How can I do so ?


Database Response without any Request

Posted: Sun Nov 02, 2014 8:49 pm
by obullei

Hello!

Please take a look here: http://devcenter.appery.io/documentat...


Database Response without any Request

Posted: Sun Nov 02, 2014 8:55 pm
by Abhigyan Singh

I have already looked into that... Please check my problem...
I need the values of the last row without any request... just response on a button click event.


Database Response without any Request

Posted: Mon Nov 03, 2014 4:29 am
by Yurii Orishchuk

Hi Abhigyan,

Generally update/create service returns only "_id" of created/modified row.

So you have to ways to get full data after service success:

1 Invoke "Read" service - with "_id" returned by "create/update" service. In this case app will send two request for this goal.

2 Implement custom Server script that will:
2.1. Create/update item.
2.2. After item is created/updated - get's this item from DB and return's received item as response. In this case app will produce just one request to the server.

Regards.


Database Response without any Request

Posted: Sat Nov 08, 2014 1:39 pm
by Abhigyan Singh

Like I dont have any _id or any data.
I click a button then I should get the last row _id from the specified collection.
How can I get the last row ?


Database Response without any Request

Posted: Mon Nov 10, 2014 3:07 am
by Yurii Orishchuk

Hi Abhigyan,

You can get last row with following way:

1 Open list service to the collection you need.

2 Navigate to "request" tab and add following parameters in "query string" section: http://prntscr.com/54u3sk/direct

limit = 1
sort = "_createdAt"

3 Navigate to "Test" tab. And click on "Test" button.

4 You will get only one item (last created). http://prntscr.com/54u49s/direct

See more about queries here: http://devcenter.appery.io/documentat...

Regards