Skip to content

Commit

Permalink
Merge pull request #22 from alechirsch/related-fields-sort-filter
Browse files Browse the repository at this point in the history
Filter and Sort on related fields, filter by like, gt, lt, etc..
  • Loading branch information
jamesdixon authored Sep 15, 2016
2 parents 76c2403 + 32eb5eb commit ea9893c
Show file tree
Hide file tree
Showing 4 changed files with 613 additions and 44 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ If you're returning a single resource from a call such as `GET /customers/1`, ma
`options` | Description
:------------- | :-------------
filter _object_ | Filters a result set based specific field. Example: `/pets?filter[name]=max` would only return pets named max.
filter _object_ | Filters a result set based specific field. Example: `/pets?filter[name]=max` would only return pets named max. Keywords can be added to filters to give more control over the results. Example: `/pets?filterType[pet][like]=ax` would only return pets that have "ax" in their name. The supported types are "like", "not", "lt", "lte", "gt", and "gte". Both "like" and "not" support multiple values by comma separation. NOTE: This is not supported by JSON API spec.
fields _object_ | Limits the fields returned as part of the record. Example: `/pets?fields[pets]=name` would return pet records with only the name field rather than every field.
include _array_ | Returns relationships as part of the payload. Example: `/pets?include=owner` would return the pet record in addition to the full record of its owner. _Note:_ you may override an `include` parameter with your own Knex function rather than just a string representing the relationship name.
page _object/false_ | Paginates the result set. Example: `/pets?page[limit]=25&page[offset]=0` would return the first 25 records. If you've passed default pagination parameters to the plugin, but would like to disable paging on a specific call, just set `page` to `false`.
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
},
"dependencies": {
"bookshelf-page": "0.3.2",
"inflection": "^1.10.0",
"lodash": "4.13.1"
}
}
Loading

0 comments on commit ea9893c

Please sign in to comment.