This question is locked. New answers and comments are not allowed.
i am trying to download data from the back-end services with a number of conditions that must be satisfied.
i achieved this in swift for the ios version of the app using a NSPredicate
request
.predicate
=
NSPredicate
(
format
:
"CreatedByName == %@ OR (To ==%@ AND CreatedByName == %@)"
,
userOne,
userID,
UserTwo
)
i need a similar solution for the javascript api. my problem is knowing hopw to combine the AND and OR. I have Tried:
var
query =
new
Everlive.Query();
query.where().and()
.eq(
'CreatedBy'
, customerName)
.eq(
'To'
, to)
.done();
But how do i add the or.
It is a messing section of an app the admin can chat with any end user but the end user can only reply to the admin or or send messages to the admin so my query needs to reflect that in a chat stream. ie. is (created by admin AND is to userA ) OR (is created by userA)