How doing a db query how do you write a wildcard search i.e return all Cities beginning with 'SA' or all cities that contain 'ck'?
How doing a db query how do you write a wildcard search i.e return all Cities beginning with 'SA' or all cities that contain 'ck'?
Hi Andrew,
You can use regular expressions (Regexp).
For example, to search cities beginning with SA* you should create following mask:code{City:{$regex: "SA"}}/code
A follow up question on writing where clauses with multiple queries
I am writing a multiple where clause where one input is a local storage variable (VariableA) and the other is an input field (InputA.Text), can you please help with providing the proper syntax
{"Name": {"$regex": InputA.Text},"id._id":VariableA}
A secondary question, for a Database Service if I am using the Query service can I add new parameters to the query service i,e. Name and id._id
Hi,
For creating the request to database you would need to map localStorage variable to Request parameter "where"
Then click "Add JS" and paste the following code:
codevar inputValue = Tiggzi("InputA").val();
var whereClause = {"Name": {"$regex": inputValue},
"id._id": value};
return JSON.stringify(whereClause);/code
As for your secondary question, for a Database Service if I am using the Query service can I add new parameters to the query service i,e. Name and id._id
Query Service accepts "where" parameter only. If you need to create request by field Name or id._id then you would need to generate request as I wrote above.
I think I am facing with limitation of the query.. ![]()
there is Case sensitive problem .. (Dog is not same with dog)...
{"locmaps": {"$regex": 'Dog'} };
is there any switch or option to turn off case-sensitive?
please help
thanks
Please try this:pre
{"locmaps": {"$regex": "(?i)Dog"}}/pre