Using ?WHERE= in URL database call
Thank you, we'll take a look.
Catch up wih the Appery.io community on our forum. Here you'll find information on the lastest questions and issues Appery.io developers are discussing.
https://forum.appery.io/
Thank you, we'll take a look.
This is how the request looks
https://api.appery.io/rest/1/db/colle...
This, with the below code brings all rows back, not just the ones with 6 in the sid coll.
url: 'https://api.appery.io/rest/1/db/colle...',
dataType: 'json',
contentType: 'application/json',
data: {
where: {sid: sid}
},
What is 'sid'? Is it a variable?
Parameter 'where' should have this format:pre{"sid": "sid"}/prehttp://docs.appery.io/documentation/b...
The first sid is the name of the colume, the second is a variable. If I enter it like this, in the url, it says 'sid' instead of the number '6' ?
I have had another play, and still I cannot make it work. Something is wrong with how its sent to the database.
If I add JSON.stringify() it comes back empty, if i remove it, it comes back with all the collection.
What am I doing wrong ?
You don't need to use codeJSON.stringify()/code, if 'sid' is a variable then use parameter 'where' this way:prewhere: {"sid": sid}/pre
Yes, I have tried this, but still it brings back all rows, and not only the rows where sid = 6
This is what is wrong
I have tried to change the database col from number to string, and back to number, thinking it was that, as the above code from Igor seemed to work.
But still it brings back all records, regardless of the number in sid col
Hello! Sorry, but we don't see ajax in your urVoice project. There is only service with request to DB and in where parameter you set pre{"area_type" : {ar}. "area" : {an}}/preit's not correct. What do you mean on {ar} and {an}?
The code I have put above, like that of the original user, which is also me, is for an external website, that needs to do the backend work of the app.
I need the user to get the questions they have asked. The code should send a REST API request to get those questions. But its not giving me the questions where SID = 6, it is giving me all of them.
The where clause is not working, its sending it, but the database returns all records, ignoring the WHERE clause ?