Add more description about the filter arg for find()

This commit is contained in:
Raymond Feng 2013-08-26 17:47:52 -07:00
parent 09113a955d
commit ba7df8d9ba
1 changed files with 31 additions and 7 deletions

View File

@ -276,12 +276,36 @@ Find all instances of Model, matched by query. Fields used for filter and sort s
**filter** **filter**
- **where** `Object` { key: val, key2: {gt: 'val2'}} - **where** `Object` { key: val, key2: {gt: 'val2'}} The search criteria
- **include** `String`, `Object` or `Array`. - Format: {key: val} or {key: {op: val}}
- **order** `String` - Operations:
- **limit** `Number` - gt: >
- **skip** `Number` - gte: >=
- **fields** `Object|Array|String` - lt: <
- lte: <=
- between
- inq: IN
- nin: NOT IN
- neq: !=
- like: LIKE
- nlike: NOT LIKE
- **include** `String`, `Object` or `Array` Allows you to load relations of several objects and optimize numbers of requests.
- Format:
- 'posts': Load posts
- ['posts', 'passports']: Load posts and passports
- {'owner': 'posts'}: Load owner and owner's posts
- {'owner': ['posts', 'passports']}: Load owner, owner's posts, and owner's passports
- {'owner': [{posts: 'images'}, 'passports']}: Load owner, owner's posts, owner's posts' images, and owner's passports
- **order** `String` The sorting order
- Format: 'key1 ASC, key2 DESC'
- **limit** `Number` The maximum number of instances to be returned
- **skip** `Number` Skip the number of instances
- **offset** `Number` Alias for skip
- **fields** `Object|Array|String` The included/excluded fields
- `['foo']` or `'foo'` - include only the foo property - `['foo']` or `'foo'` - include only the foo property
- `['foo', 'bar']` - include the foo and bar properties - `['foo', 'bar']` - include the foo and bar properties
- `{foo: true}` - include only foo - `{foo: true}` - include only foo