Page 2 of 2

Query Service with multiple "Where" parameters

Posted: Tue Jan 27, 2015 6:09 am
by M&M

I understand. You can easily change those to pick up your values and execute the query. Say for example you are storing the values of Category and Estate when the user clicks on the item to 2 different Local Storage variables. You just need to change the where value to

{"$and": [{"Category": '"' + localStorage.getItem('lsvCat') + '"'}, {"Estate": '"' + localStorage.getItem('lsvEstate') + '"'}]} // Put this in the where value

Alternatively you can read em off using JS and return this value to the where clause

var where = {
"$and": [
{"Category": '"' + Apperyio('compCategory').val() + '"'},
{"Estate": '"' + Apperyio('compEstate').val() + '"'}
]
};
return JSON.stringify(where);

As always there is more than one way of doing things. One of the methods should be of use to you


Query Service with multiple "Where" parameters

Posted: Tue Jan 27, 2015 12:05 pm
by Rui Song Chong

Hi, this is what I want, thank you so much!