Uploaded image for project: 'Magnolia REST Framework'
  1. Magnolia REST Framework
  2. MGNLREST-351

Filtering with operation "contains-any"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • None
    • None
    • None

      Let say I have a product node with field categories as below

      "categories": [
        "98a69699-0acd-4d8d-b743-9d9fb2b9830a", 
        "ae5dae88-488b-43ac-b857-b142d2fa3c33"
      ],

      With url http://localhost:8080/magnoliaAuthor/.rest/delivery/products?categories=98a69699-0acd-4d8d-b743-9d9fb2b9830a&categories=ae5dae88-488b-43ac-b857-b142d2fa3c33 & [http://localhost:8080/magnoliaAuthor/.rest/delivery/products?categories[eq]=98a69699-0acd-4d8d-b743-9d9fb2b9830a&categories[eq]=ae5dae88-488b-43ac-b857-b142d2fa3c33], we could filter out products which contains at least these 2 categoryIds.

      To achieve the "contains-any" operation, we try to negate the OR operation to AND-NOT-EQUAL operation with below url http://localhost:8080/magnoliaAuthor/.rest/delivery/products?categories[ne]=00000000-0000-0000-0000-000000000000, however, no products could be returned from such rest url. Seems a bit strange for the [eq] operator working on the uuid-list field while [ne] is not.

      Would like to know if any chance there is an already-built function where we could achieve such use case. Please advise and thanks.

        Acceptance criteria

              Unassigned Unassigned
              dchung Davis Chung
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:

                  Bug DoR
                  Task DoD