I could do with a little help on a DB query. I want to return rows WHERE: One field of the row matches a local variable AND another is NOT NULL.
The names:
Database field is: "CaptureEntry_By" (string) (should not be NULL)
Local variable is "VarSessionID" which must match database field "Session_ID"
So far the best I have managed is this:
var SessionID = localStorage.getItem("VarSessionID");
return '{"$and": [{"Session_ID": "'+SessionID+'"},{"SessionEntry_By": {"$exists":false}}]}';But it fails (doesnt return anything)
The other question I have is, do I have to input these Where statements at the Service level or can I do it in the data source mapping? At present I'm doing it with duplicate services but its messy. It would be much nicer to do it in the mapping somehow.