Couchbase Lite query in Swift for N1QL query?

Hi Team,

Can you please suggest the Couchbase lite swift query for below N1QL query?

“SELECT sellingFood,soldFood LET sellingFood = (” SELECT * FROM db where type = ‘food’ AND isSold = true AND foodID = ‘1’ “), soldFood = (” SELECT * FROM db where type = ‘food’ AND isSold = false AND foodID = ‘1’ “)”

Thanks in Advance

Couchbase lite does not support sub queries at this time. You’d have to issue the query that fetches records where isSold is either TRUE or FALSE and then segregate records at the app layer.