Skip to content

Set custom regex option for comparing string #39

@starnowski

Description

@starnowski

Add ability to specify custom regex pattern option ("i", "m", "x", etc.) when comparing string

As developer I would like to compare string values with specific regex options like:

  • eq: add option to compare string by using $regex pattern instead of $eq, and set passed regex options
  • startswith: add option to compare string by using $regex pattern with passed regex options
  • endswith: add option to compare string by using $regex pattern with passed regex options
  • contains: add option to compare string by using $regex pattern with passed regex options

Add posibility to spefiy regex option to all operations (eq, startswith, endswith and contains) and to particular opertations separetly.
The regex option specified for particula operation have higher prority than those one for all operations.

For case when the regex patern is not static value (expression required) then the policy option need to be specified.

  • Default policy: the regex option are not applied to eq, startswith, endswith, contains
  • Policy with exception: exception is thrown when such case occurs
  • Apply regex pattern: the regex pattern is used for dynamic pattern value (warning) there is assumption that jamalingo can not qoute or escape potential values. The comment must be added that such behaviour must be unsafed. Mongo can not qoute values in aggregation pipeline.

Important! The functionality is not compatible with OData specification, it is customization

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions