Lines 972-984
info:
Link Here
|
972 |
We can refine that with more complex matching clauses by nesting a the clause into the |
972 |
We can refine that with more complex matching clauses by nesting a the clause into the |
973 |
object; `{ "fieldname": { "clause": "value" } }`. |
973 |
object; `{ "fieldname": { "clause": "value" } }`. |
974 |
|
974 |
|
975 |
Available matching clauses include `>`, `<`, `>=`, `<=`, `-like`, and `-not_like`. |
975 |
Available matching clauses include `=`, `!=`, `<`, `>`, `<=`, `>=` and `-not`. We also support `-like` |
|
|
976 |
and `-not_like` string comparisons with `%` used to denote wildcards, thus you can pass |
977 |
`{ "fieldname": { "-like": "value%" } }` to do a 'starts with' string match for example. |
976 |
|
978 |
|
977 |
We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH` |
979 |
We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH` |
978 |
level will result in an "AND" query, whilst combinding them in an `ARRAY` will result in an |
980 |
level will result in an "AND" query, whilst combinding them in an `ARRAY` will result in an |
979 |
"OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those |
981 |
"OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those |
980 |
results with both field1 containing value2 AND field2 containing value2 for example. |
982 |
results with both field1 containing value2 AND field2 containing value2 for example. |
981 |
|
983 |
|
|
|
984 |
There is a collection of special operators also available to you, including: |
985 |
|
986 |
* `-in` - Expects an array of values to perform an OR match against |
987 |
* `-not_in` - Expects an array of values to perform a NOR match against |
988 |
* `-between` - Expects two values which the value of the field is expected to fall between |
989 |
* `-not_between` - Expects two values which the value of the field is expected to fall outside of |
990 |
* `-ident` - Expects a second field name to match the two field values against |
991 |
* `-regexp` - Expects a perl compatible regular expression for which the value should match |
992 |
|
993 |
Logic and nesting is also supported and you may use `-and` and `-or` to change the logic of an ARRAY |
994 |
or HASH as described above. |
995 |
|
982 |
Additionally, if you are requesting related data be embedded into the response one can query |
996 |
Additionally, if you are requesting related data be embedded into the response one can query |
983 |
on the related data using dot notation in the field names. |
997 |
on the related data using dot notation in the field names. |
984 |
|
998 |
|
985 |
- |
|
|