Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-556

Add "in" operator as syntactic sugar for a chain of "or" expressions

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: V4.0_CSD03
    • Fix Version/s: V4.01_WD01
    • Component/s: URL Conventions
    • Environment:

      New Query Capabilities

      Description

      In data analysis it is common to retrieve data that matches one of several distinct values, reflected in SQL as the IN operator.

      This is syntactic sugar, so we need to balance between a convenient notation and adding value to the expression syntax that we already have.

      1) Using JSON collections and a new "in" operator:

      CountryCode in ["US","CA","DE"]

      or in a more URL-friendly notation (as double quotes and square brackets require percent-ending)

      CountryCode in ('US','CA','DE')

      2) Allowing arbitrary collection expressions on the left side of lambda expressions:

      ["US","CA","DE"]/any(c:c eq CountryCode)

      3) Adding an overload to the contains function:

      contains(["US","CA","DE"], CountryCode)

        Attachments

          Activity

            People

            • Assignee:
              handl Ralf Handl
              Reporter:
              handl Ralf Handl
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: