Thapelo Radebe
Posts: 0
Joined: Mon Mar 18, 2013 8:01 am

WHERE clause on the rest service

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.

Thapelo Radebe
Posts: 0
Joined: Mon Mar 18, 2013 8:01 am

WHERE clause on the rest service

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

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

WHERE clause on the rest service

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

Thapelo Radebe
Posts: 0
Joined: Mon Mar 18, 2013 8:01 am

WHERE clause on the rest service

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

Thapelo Radebe
Posts: 0
Joined: Mon Mar 18, 2013 8:01 am

WHERE clause on the rest service

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

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

WHERE clause on the rest service

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

Return to “Issues”