So I have a similar situation. I want to search on multiple columns in the database. This is what I tried but it didn't work.
var select = localStorage.getItem("bookid");
var search = Apperyio("mobilesearchbar_282").val();
var cow = Apperyio("mobiletextinput_cowidd");
var sire = Apperyio("mobiletextinput_405sire") ;
var color = Apperyio("mobiletextinput_406color ");
return '{"$and":[{"Book":"'+select +'"},{"calf_id":"'+search +'"},{"cow_id":"'+cow+'"},{"sire":"'+sire+'"},{"color":"'+color+'"]}';
What I originally had is this and it worked the way it was supposed to. What it was supposed to do was based on what was selected in a menu (I think this is where the select variable come in) it would search for what was typed in the box. The problem is that it only searches with in one column, the calf_id column. I want it to search in other columns as well.
var select = localStorage.getItem("bookid");
var search = Apperyio("mobilesearchbar_282").val();
return '{"$and":[{"Book":"'+select +'"},{"calf_id":"'+search +'"} ]}';
Any idea what I did wrong?