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

Add NSPredicate-specific operators to NSExpression #11013

Closed

Description

@1ec5

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

Activity

  1. added
    iOS
    macOS
    on Jan 24, 2018
  2. added this to the milestone on Jan 24, 2018
  3. 1ec5 commented on Feb 6, 2018

    @1ec5
    ContributorAuthor

    Most likely blocked by #10720.

  4. added
    release blocker
    on Mar 28, 2018
  5. 1ec5 commented on Mar 28, 2018

    @1ec5
    ContributorAuthor

    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

  6. fabian-guerra commented on Apr 12, 2018

    @fabian-guerra
    Contributor

    Fixed in #11632

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

iOSmacOSrelease blockerruntime styling

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions