Lines 729-741
info:
Link Here
|
729 |
We can refine that with more complex matching clauses by nesting a the clause into the |
729 |
We can refine that with more complex matching clauses by nesting a the clause into the |
730 |
object; `{ "fieldname": { "clause": "value" } }`. |
730 |
object; `{ "fieldname": { "clause": "value" } }`. |
731 |
|
731 |
|
732 |
Available matching clauses include `>`, `<`, `>=`, `<=`, `-like`, and `-not_like`. |
732 |
Available matching clauses include `=`, `!=`, `<`, `>`, `<=`, `>=` and `-not`. We also support `-like` |
|
|
733 |
and `-not_like` string comparisons with `%` used to denote wildcards, thus you can pass |
734 |
`{ "fieldname": { "-like": "value%" } }` to do a 'starts with' string match for example. |
733 |
|
735 |
|
734 |
We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH` |
736 |
We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH` |
735 |
level will result in an "AND" query, whilst combinding them in an `ARRAY` will result in an |
737 |
level will result in an "AND" query, whilst combinding them in an `ARRAY` will result in an |
736 |
"OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those |
738 |
"OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those |
737 |
results with both field1 containing value2 AND field2 containing value2 for example. |
739 |
results with both field1 containing value2 AND field2 containing value2 for example. |
738 |
|
740 |
|
|
|
741 |
There is a collection of special operators also available to you, including: |
742 |
|
743 |
* `-in` - Expects an array of values to perform an OR match against |
744 |
* `-not_in` - Expects an array of values to perform a NOR match against |
745 |
* `-between` - Expects two values which the value of the field is expected to fall between |
746 |
* `-not_between` - Expects two values which the value of the field is expected to fall outside of |
747 |
* `-ident` - Expects a second field name to match the two field values against |
748 |
* `-regexp` - Expects a perl compatible regular expression for which the value should match |
749 |
|
750 |
Logic and nesting is also supported and you may use `-and` and `-or` to change the logic of an ARRAY |
751 |
or HASH as described above. |
752 |
|
739 |
Additionally, if you are requesting related data be embedded into the response one can query |
753 |
Additionally, if you are requesting related data be embedded into the response one can query |
740 |
on the related data using dot notation in the field names. |
754 |
on the related data using dot notation in the field names. |
741 |
|
755 |
|
742 |
- |
|
|