Searching, filtering, paging
Querying lists with POST /query: filter tree of AND/OR groups, all operators, search patterns with LIKE, paths across relations, sorting, pages, and the filters the server always adds.
Topics in this subject area
- 1.Structure of a search
What a search request looks like:
response,parameterwithquery,order,page,limit,meta, and which default values apply. - 2.All filter operators
EQ, NEQ, LIKE, IN, ISNULL, ISNOTNULL, BEFORE, AFTER, SAMEORBEFORE, SAMEORAFTER, MEMBEROF: what each one means, which field types it applies to and how the value is written.
- 3.Search patterns with LIKE: % and _
How the placeholders
%and_work in a LIKE search, why CDMS does not add%automatically, that there is no escaping, and what upper and lower case depend on. - 4.AND/OR groups
How
type,filterandgroupform a filter tree, why the default is OR and how the tree becomes a condition. - 5.Filtering and sorting across relations
Dot notation like
customer.address.city: how CDMS joins the tables for it and why objects without the relation do not drop out. - 6.Searching collections with MEMBEROF
How you find the objects whose list contains a certain element, and why MEMBEROF on a non-list field is rejected.
- 7.Sorting
Several sort criteria, direction ASC/DESC/NONE, sorting across relations, and what happens with a wrong sort path.
- 8.Paging and match count
How
page,limitandmetawork together, whylimit: -1returns everything, and wheretotalCountcomes from. - 9.Filters in nested lists
When a
parametergoes at the top level and when inside aresponseentry, and what this means for the amount of data. - 10.Date and time values
In which format dates, times and timestamps are written, and how time ranges are filtered.
- 11.Filters that always run along
What the server invisibly adds to every search: owner, attribute filters, custom mandatory filters, and that the tenant takes effect through the choice of database. Explains why two persons see different matches.
- 12.When a filter does not fit
What happens with a missing key, a wrong operator, a value that does not fit, an invalid UUID, an unknown field or an unresolvable mandatory filter.