Hi Joe,
It depends on what query you want to create. Could you please show an example of data and desired result?
Hi Joe,
It depends on what query you want to create. Could you please show an example of data and desired result?
Katya,
No problem. Assume all the same circumstances discussed earlier. Everything is the same, but I want to search four columns instead of just one. All the data being searched is in string format.
example:
I have four columns in my database with string data.
I want to search the data in the columns using a search bar.
I want the response to display in a grid.
I want to be able to search any keyword from any of the columns in the search, if possible.
This code searches one column name in the query service request where parameter:
return '{"column1_name":{"$regex":"^'+value+'", "$options":"i"}}';
How do I edit the above js code to search all four columns?
Let me know if more illustration is needed.
Thanks again,
Joe
Joe,
You can use $or for sample from different columns, for example:pre{"$or":[{"my":"1"},{"my2":"2"}]}/prereturns all the records with my=1 or my2=2. Then you can change the condition.
Katya you are awesome!
Thanks so much for all your continued help!
Joe
maryna, can the search component work with a database? For example, can I use that component instead of the input/button component combo to query from a db?
Thanks
Hello! Yes, you can.
and if so can I follow this tutorial and just incorporate the search component where the input/button are: http://docs.appery.io/tutorials/build...
Followed the steps above to get the search working on my app. If I want to search for something called "Lion" is it possible to be getting results when just an "L" is typed instead of when the whole word is there?
Hello!
Use regular expressions for this http://devcenter.appery.io/documentat...