Abhigyan Singh
Posts: 0
Joined: Sat Nov 01, 2014 9:01 am

Database Response without any Request

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

obullei
Posts: 0
Joined: Thu Jun 05, 2014 12:17 am

Database Response without any Request

Hello!

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

Abhigyan Singh
Posts: 0
Joined: Sat Nov 01, 2014 9:01 am

Database Response without any Request

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.

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

Database Response without any Request

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.

Abhigyan Singh
Posts: 0
Joined: Sat Nov 01, 2014 9:01 am

Database Response without any Request

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 ?

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

Database Response without any Request

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

Return to “Issues”