Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Add NSPredicate-specific operators to NSExpression #11013

Closed
3 tasks
1ec5 opened this issue Jan 24, 2018 · 3 comments
Closed
3 tasks

Add NSPredicate-specific operators to NSExpression #11013

1ec5 opened this issue Jan 24, 2018 · 3 comments
Assignees
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS release blocker Blocks the next final release runtime styling

Comments

@1ec5
Copy link
Contributor

1ec5 commented Jan 24, 2018

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:

  • BETWEEN (equivalent to >= AND <=)
  • IN (reverse of CONTAINS)
  • CONTAINS (based on the has operator)

/cc @jmkiley @anandthakker

@1ec5 1ec5 added iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS runtime styling labels Jan 24, 2018
@1ec5 1ec5 added this to the ios-v4.0.0 milestone Jan 24, 2018
@1ec5
Copy link
Contributor Author

1ec5 commented Feb 6, 2018

Most likely blocked by #10720.

@1ec5 1ec5 added the release blocker Blocks the next final release label Mar 28, 2018
@1ec5
Copy link
Contributor Author

1ec5 commented Mar 28, 2018

CONTAINS (based on the has operator)

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.

/cc @fabian-guerra

@fabian-guerra
Copy link
Contributor

Fixed in #11632

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS release blocker Blocks the next final release runtime styling
Projects
None yet
Development

No branches or pull requests

2 participants