List all entities
#
IndexIn order to get all entities, all we have to do is send a GET
request to the collections path.
If you wanted to get all todos, the request would look like this:
#
PaginationPagination is enabled by default on all of your Architect entities, with a default page size of 20
.
To change the page size when listing entities, send a PER_PAGE
header along with your request.
note
Maximum page size is 100
. Enterprise users can change this.
In the response headers of your GET
request, you will receive a TOTAL_PAGES
value. To get a specific page, just add a PAGE
header.
An example request would look like this:
#
Queries & FiltersQuerying with Architect is easy as 1-2-3. To query our todos by title, we would simply pass a title
query parameter with the GET
request.
More complex queries can be represented as an object, which can be stringified into a query string. We recommend using this package and it's stringify
method for that purpose.
#
Contains filterIf we wanted to get all todos that contain the word milk
in their title, our parameters would look like this:
- JSON
- Query string
#
Min / max filterLet's say we wanted to filter our todos even more:
- JSON
- Query string
#
Nested fieldsFiltering by a nested field is a breeze:
- JSON
- Query string
#
Array contains filterSay we want to filter only the todos that have "groceries" and "apples" categories. We would accomplish that using the _arr_contains
filter.
- JSON
- Query string
#
And / or operationsIn a more complex scenario, we can also use the _or
and _and
operations.
In this example, we'll try to fetch todos that are either named Buy milk
, or are named Try Architect
and assigned to anyone named John
. The query, represented in JSON format, would look like this:
- JSON
- Query string