Page 1 of 1

WHERE clause on the rest service

Posted: Sat Aug 31, 2013 4:28 pm
by Thapelo Radebe

How do i add the WHERE clause to the rest service for listing database entries?
and if i run it manually like this

curl -X POST
-H "X-Appery-Database-Id: 4ffcf6c8e4b0211629c4ad01"
-H "Content-Type: application/json"
-d "{'taskName':'Build an app', 'priority':'High'}"
https://api.appery.io/rest/1/db/colle...

where do i run it? i'm lost.

I can run everything on my server but i prefer the appery cloud, wish GUI had mysql Clauses like the "WHERE" clause.


WHERE clause on the rest service

Posted: Sat Aug 31, 2013 4:43 pm
by Illya Stepanov

Hello,

you can check here :: http://docs.appery.io/documentation/b...


WHERE clause on the rest service

Posted: Sat Aug 31, 2013 4:50 pm
by Thapelo Radebe

i posted the question coming from that link you share, i'm a novice so i don't know where to put that code. I'm used to doing PHP, Mysql with json_encode and then map but i don't know where to put that code.

do i put it on the server side scripts or create a javascript file and run it from there?

i'm lost


WHERE clause on the rest service

Posted: Sat Aug 31, 2013 5:58 pm
by Illya Stepanov

I recommend you to explore our tutorials.
In this tutorial shows exactly how to setup a 'where' query:
http://docs.appery.io/tutorials/build...


WHERE clause on the rest service

Posted: Sat Aug 31, 2013 7:04 pm
by Thapelo Radebe

Thank you, you have the best product and the best service ever


WHERE clause on the rest service

Posted: Tue Sep 03, 2013 12:20 am
by Thapelo Radebe

your answer was correct but what do i do when i have multiple WHERE clauses?


WHERE clause on the rest service

Posted: Tue Sep 03, 2013 2:20 am
by Illya Stepanov

Hi - theoreticaly you can use a "$where" clause with JavaScript, but you should test it.

For example this two queries are equivalent:

code

... ({"$where" : "this.x + this.y == 10"})

/code

code

... ({"$where" : "function () { return this.x + this.y == 10; }"})

/code