0

I'm trying to filter JSON:API results based on the "greater than" operator (>).

The filtering documentation lists the operators:

\Drupal\jsonapi\Query\EntityCondition::$allowedOperators = [
  '=', '<>',
  '>', '>=', '<', '<=',
  'STARTS_WITH', 'CONTAINS', 'ENDS_WITH',
  'IN', 'NOT IN',
  'BETWEEN', 'NOT BETWEEN',
  'IS NULL', 'IS NOT NULL',
];

But it also notes that the symbol operators need to be encoded:

&filter[a-label][condition][operator]=%3D  <- encoded "=" symbol

Which "encoding" is this referring to? What is the encoding for the other operators (>, >=, etc.)? How do I look them up?

1
0

Thanks to Hudri, here's the list:

  • = %3D
  • <> %3C%3E
  • > %3E
  • >= %3E%3D
  • < %3C
  • <= %3C%3D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.