srikanth
Posts: 0
Joined: Tue Nov 20, 2012 6:18 am

How to use a value from a local storage variable in a where clause? and also using the contained in ($in) comparison?

How to use a value from a local storage variable in a where clause?
and also using the contained in ($in) comparison?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to use a value from a local storage variable in a where clause? and also using the contained in ($in) comparison?

Do you need to use it in mapping or when you test the service?

srikanth
Posts: 0
Joined: Tue Nov 20, 2012 6:18 am

How to use a value from a local storage variable in a where clause? and also using the contained in ($in) comparison?

What i needed was help with what the exact query shud be for the where clause. While mapping. i.e
I have a collection with 2 columns. "type" and "city" ,what we want is a response of all rows 'where type contains "xyz" '

Also i have a local storage variable's value ("xyz") that i need to use in the above where clause.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to use a value from a local storage variable in a where clause? and also using the contained in ($in) comparison?

http://docs.tiggzi.com/documentation/...

To add another constraint:
{"priority": "High", "type":"some_type"}

You would define 'where' as the request parameter and then create the query in JavaScript. You can map one local storage variable as shown in the link above or read the variables using the API directly.

srikanth
Posts: 0
Joined: Tue Nov 20, 2012 6:18 am

How to use a value from a local storage variable in a where clause? and also using the contained in ($in) comparison?

now confused....

by using this constraint as default for "where" request parameter works {"priority": "High", "type":"some_type"} but

we want the value of "priority" in this case "high" and "type" in this case "some_type" to be the values from local_storage variables and not predefined as default

If we have to use javascript, please can you give me a step by step sample

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to use a value from a local storage variable in a where clause? and also using the contained in ($in) comparison?

You would read the data from local storage:

var value1 = localStorage.getItem('name1');

then do something like this:

return '{"value":"'+value1+'"}';

Return to “Issues”