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
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Add NSPredicate-specific operators to NSExpression #11013
The NSExpression-based property value implementation in #10726 doesn’t support all the same predicate operators (for conditional expressions) that the NSPredicate-based filter implementation supports:
To clarify, CONTAINS is typically used to check whether an array contains an item. (This is one of the most common predicate operators.) In a JSON expression, match would be used for this purpose rather than has. match supports multiple values in a case, so I’d expect a filter like ["in", 1, 2, 3] to be translated into ["match", [1, 2, 3], true, false]. Until we support that syntax in NSExpression (#11539), we’ll need to use the MGL_FUNCTION syntax being introduced in #11472.
Activity
1ec5 commentedon Feb 6, 2018
Most likely blocked by #10720.
1ec5 commentedon Mar 28, 2018
To clarify,
CONTAINSis typically used to check whether an array contains an item. (This is one of the most common predicate operators.) In a JSON expression,matchwould be used for this purpose rather thanhas.matchsupports multiple values in a case, so I’d expect a filter like["in", 1, 2, 3]to be translated into["match", [1, 2, 3], true, false]. Until we support that syntax in NSExpression (#11539), we’ll need to use theMGL_FUNCTIONsyntax being introduced in #11472./cc @fabian-guerra
fabian-guerra commentedon Apr 12, 2018
Fixed in #11632