You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to fetch results using a complex query which is similar to the one below. I am not sure how to design it to get the right results
(FIELDA = 'A' or FIELDA = 'B' or FIELDA = 'C') AND (FIELDB ='AA' or FIELDB = 'BB' or FIELDC = 'CC') AND FIELDC !='123' AND FIELDC !='345' AND FIELDC !='789'
var fieldAQuery = query.where('FIELDA', '=', 'A').or('FIELDA' ,'=', 'B').or('FIELDA', '=' ,'C');
var fieldBQuery = query.where('FIELDB', '=', 'AA').or('FIELDB', '=', 'BB').or('FIELDB', '=', 'CC');
var fieldCQuery = query.where('FIELDC', '!contains', '123').and('FIELDC', '!contains', '345').and('FIELDC', '!contains', '789');
And then once you have those parts you can and them together.
var finalQuery = fieldAQuery.and(fieldBQuery).and(fieldCQuery);
On the plus side, we are currently working on supporting an additional "in" operator for many fields in WSAPI which will greatly simplify these queries in the future.
I am trying to fetch results using a complex query which is similar to the one below. I am not sure how to design it to get the right results
(FIELDA = 'A' or FIELDA = 'B' or FIELDA = 'C') AND (FIELDB ='AA' or FIELDB = 'BB' or FIELDC = 'CC') AND FIELDC !='123' AND FIELDC !='345' AND FIELDC !='789'
The query I designed is as below
I am not sure if I am doing anything wrong here
The text was updated successfully, but these errors were encountered: