Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • eq means =
  • ne means <>
  • lt means <
  • gt means >
  • lte means <=
  • gte means >=
  • like means LIKE
  • in means IN
  • not-in means NOT IN

Usage notes

  • If no operator is provided, eq is used by default.

  • The value in the filter parameter is treated as String .

  • Use brackets to pass an operator, for example [eq], [ne], [lt], and so on.

  • For in and not-in, a range symbol ~ (the tilde) should be provided, for example:

    Code Block
    https://example.com/.rest/delivery/pages/v1?mgnl:created[in]=2018-01-01~2018-02-01

...

  • Date:  yyyy-MM-dd

    Code Block
    2018-01-01
  • Datetime:  yyyy-MM-dd'T'HH:mm:ss.SSSXXX

    Code Block
    2018-01-11T10:26:47.438+07:00

Filter types

Property filter

Filter for a property of the node. The value for the property must be an exact match.

Mgnl mini code snippet
Stylesimple

author=Magnolia%20Travels

@name property filter

Filter for the node name.

Mgnl mini code snippet
Stylesimple

@name=travel

@ancestor filter

Filter for ancestor nodes of a provided path. The path must be absolute in the given workspace of the given workspace prefix.

Mgnl mini code snippet
Stylesimple

@ancestor=/travel/about/careers/marketing-associate

Notes on using filters

  • If no operator is provided, eq is used by default.

  • The value in the filter parameter is treated as String .

  • Use brackets to pass an operator, for example [eq][ne][lt], and so on.

  • For in and not-in, a range symbol ~ (the tilde) should be provided, for example:

    Code Block
    https://example.com/.rest/delivery/pages/v1?mgnl:created[in]=2018-01-01~2018-02-01
  • For filtering by date and time, only two ISO 8601-based formats are accepted. The patterns shown are in JAVA notation ( java.text.SimpleDateFormat ):

    • Date:  yyyy-MM-dd

      Code Block
      2018-01-01
    • Datetime:  yyyy-MM-dd'T'HH:mm:ss.SSSXXX

      Code Block
      2018-01-11T10:26:47.438+07:00
  • If a filter can have multiples possible values which must match, use | (OR):

...

If a filter can have multiples possible values which must match, use | (OR):

Mgnl mini code snippet
Stylesimple

@name=travel|about

Filter types

Property filter

Filter for a property of the node. The value for the property must be an exact match.

Mgnl mini code snippet
Stylesimple

author=Magnolia%20Travels

@name property filter

Filter for the node name.

Mgnl mini code snippet
Stylesimple

@name=travel

@ancestor filter

...

  • Mgnl mini code snippet
    Stylesimple

...

  • @name=

...

  • travel

...

  • |about

Anchor
example-queryNodes
example-queryNodes
Examples 

...