Skip to content

Cover absolute path filter queries #72

@Marcono1234

Description

@Marcono1234

It might be good to add tests for using an absolute path (that is $ instead of @) in a filter selector, e.g. $[?$.a==1]. Currently the filter tests only seem to cover relative paths (@) or invalid selectors with absolute paths, but not any valid selectors with absolute paths.

Might be good to cover:

  • existence test without segment: $[?$]
  • some 'normal' filter expressions, e.g. $[?$.a==1]
  • using (...), e.g. $[?($.a==1)]
  • equals self: $[?$==$] (similar to Add filter test for equality with self #71)
  • equals with relative path
    • selector: $[?@[0] == $[0]] and $[?$[0] == @[0]]
    • document: [0, [0, 1], [1, 2]]
  • applying the filter selector to a nested value and making sure $ is evaluated absolute and not relative, for example:
    • selector: $.a[?$.b==2]
    • document: {"a": [{"b": 1}], "b": 2}

What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions