sql(query) from ‘@velo/wix-data-sql-backend’
doesn’t allow to combine AND + OR operators with the next error:
Unsupported syntax. Reason: can not handle both AND + OR in one expression
but such expressions are achievable by:
query = wixData . query ( “Photos” ). include ( “area” ). hasSome ( “activities” , [“activity1”, “activity2”] );
query = query . and ( query . hasSome ( “tags” , [“tag1”, “tag2”] )). descending ( “rating” ). find ()
How to achieve the same (combining AND/OR) and sorting the result by the SQL? There must be some trick to that, if the . query can do it.
I need the SQL, because the . query does not allow to sort by a referenced field
Thanks