Lines 683-692
info:
Link Here
|
683 |
We can refine that with more complex matching clauses by nesting a the clause into the |
683 |
We can refine that with more complex matching clauses by nesting a the clause into the |
684 |
object; `{ "fieldname": { "clause": "value" } }`. |
684 |
object; `{ "fieldname": { "clause": "value" } }`. |
685 |
|
685 |
|
686 |
Available matching clauses include ">", "<", ">=", "<=", "-like", and "-not_like". |
686 |
Available matching clauses include `>`, `<`, `>=`, `<=`, `-like`, and `-not_like`. |
687 |
|
687 |
|
688 |
We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH` |
688 |
We can filter on multiple fields by adding them to the JSON respresentation. Adding at `HASH` |
689 |
level will result in an "AND" query, whilst combinding them in an `ARRAY` wilth result in an |
689 |
level will result in an "AND" query, whilst combinding them in an `ARRAY` will result in an |
690 |
"OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those |
690 |
"OR" query: `{ "field1": "value2", "field2": "value2" }` will filter the response to only those |
691 |
results with both field1 containing value2 AND field2 containing value2 for example. |
691 |
results with both field1 containing value2 AND field2 containing value2 for example. |
692 |
|
692 |
|
Lines 697-711
info:
Link Here
|
697 |
|
697 |
|
698 |
The following request would return any patron with firstname "Henry" and lastname "Acevedo"; |
698 |
The following request would return any patron with firstname "Henry" and lastname "Acevedo"; |
699 |
|
699 |
|
700 |
`curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": "Acevedo", "firstname": "Henry" }"` |
700 |
`curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw '{ "surname": "Acevedo", "firstname": "Henry" }'` |
701 |
|
701 |
|
702 |
The following request would return any patron whose lastname begins with "Ace"; |
702 |
The following request would return any patron whose lastname begins with "Ace"; |
703 |
|
703 |
|
704 |
`curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": { "-like": "Ace%" }"` |
704 |
`curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw '{ "surname": { "-like": "Ace%" }'` |
705 |
|
705 |
|
706 |
The following request would return any patron whose lastname is "Acevedo" OR "Bernardo" |
706 |
The following request would return any patron whose lastname is "Acevedo" OR "Bernardo" |
707 |
|
707 |
|
708 |
`curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw "{ "surname": [ "Acevedo", "Bernardo" ] }"` |
708 |
`curl -u koha:koha --request GET "http://127.0.0.1:8081/api/v1/patrons/" --data-raw '{ "surname": [ "Acevedo", "Bernardo" ] }'` |
709 |
|
709 |
|
710 |
The following request embeds the related patron extended attributes data and filters on it. |
710 |
The following request embeds the related patron extended attributes data and filters on it. |
711 |
|
711 |
|
712 |
- |
|
|