Lines 1016-1028
info:
Link Here
|
1016 |
We can refine that with more complex matching clauses by nesting a the clause into the |
1016 |
We can refine that with more complex matching clauses by nesting a the clause into the |
1017 |
object; `{ "fieldname": { "clause": "value" } }`. |
1017 |
object; `{ "fieldname": { "clause": "value" } }`. |
1018 |
|
1018 |
|
1019 |
Available matching clauses include `>`, `<`, `>=`, `<=`, `-like`, and `-not_like`. |
1019 |
Available matching clauses include `=`, `!=`, `<`, `>`, `<=`, `>=` and `-not`. We also support `-like` |
|
|
1020 |
and `-not_like` string comparisons with `%` used to denote wildcards, thus you can pass |
1021 |
`{ "fieldname": { "-like": "value%" } }` to do a 'starts with' string match for example. |
1020 |
|
1022 |
|
1021 |
We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH` |
1023 |
We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH` |
1022 |
level will result in an "AND" query, whilst combinding them in an `ARRAY` will result in an |
1024 |
level will result in an "AND" query, whilst combinding them in an `ARRAY` will result in an |
1023 |
"OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those |
1025 |
"OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those |
1024 |
results with both field1 containing value2 AND field2 containing value2 for example. |
1026 |
results with both field1 containing value2 AND field2 containing value2 for example. |
1025 |
|
1027 |
|
|
|
1028 |
There is a collection of special operators also available to you, including: |
1029 |
|
1030 |
* `-in` - Expects an array of values to perform an OR match against |
1031 |
* `-not_in` - Expects an array of values to perform a NOR match against |
1032 |
* `-between` - Expects two values which the value of the field is expected to fall between |
1033 |
* `-not_between` - Expects two values which the value of the field is expected to fall outside of |
1034 |
* `-ident` - Expects a second field name to match the two field values against |
1035 |
* `-regexp` - Expects a perl compatible regular expression for which the value should match |
1036 |
|
1037 |
Logic and nesting is also supported and you may use `-and` and `-or` to change the logic of an ARRAY |
1038 |
or HASH as described above. |
1039 |
|
1026 |
Additionally, if you are requesting related data be embedded into the response one can query |
1040 |
Additionally, if you are requesting related data be embedded into the response one can query |
1027 |
on the related data using dot notation in the field names. |
1041 |
on the related data using dot notation in the field names. |
1028 |
|
1042 |
|
1029 |
- |
|
|