Nada Al Menhali
Posts: 0
Joined: Thu Dec 15, 2016 8:19 am

I want to limit my search query to two!

I did this in my where parameter and i only get one result i have more in my database i just want two to show up

return '{"StudentGender": "'+Appery("SelectorGender").val()+'", "StudentProgram": "'+Appery("SelectorProgram").val()+'"}';

this is the code i did

i need help pls

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

I want to limit my search query to two!

try this

'{"$and":[{"StudentGender": "'+Appery("SelectorGender").val()+'"},{ "StudentProgram": "'+Appery("SelectorProgram").val()+'"}]}'

you can also use "$or" instead

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

I want to limit my search query to two!

Hello,

Please use JS below for that:

prereturn {"$and":[
{"StudentGender": Appery("SelectorGender").val()},
{"StudentProgram": Appery("SelectorProgram").val()}
]}; /pre

more information here: https://docs.appery.io/reference#data...

Return to “Issues”