← Back to team overview

dhis2-devs-core team mailing list archive

Change from OR to AND in object filter queries

 

Hi everyone

One of my tasks for 2.20 is to better handle AND/OR in object filter
queries. As part of this, we are considering changing the default from OR
to AND, which means that something like this:

?filter=id:eq:1&filter=id:eq:2

Will not work anymore, you will have to use:

?filter=id:in:[1,2]

I will backport this, so it works the same in 2.19 (so we don't have
different semantics in 2.19 vs 2.20), and in 2.20 there will probably be
introduced some kind of OR operator also (can still be useful for some
cases)

Doing this, also means that you can do proper filtering on multiple
properties, e.g.:
/api/dataElements?fields=*&filter=domainType:eq:TRACKER&filter=numberType:eq:int

Which will give the results where domain is TRACKER -AND- number type is
int.

If we all agree on this, I will also send out a notice on the mailing lists
to notify external app developers.

--
Morten

Follow ups