Sadly, HTML table format is unusable in documentation wiki. Revert to lame md format.
This commit is contained in:
parent
0fe86cf723
commit
9d55bc0002
107
docs/rest.md
107
docs/rest.md
|
@ -173,79 +173,40 @@ Pass the arguments as the value of the `find` HTTP query parameter, as follows
|
|||
where *filterType1*, *filterType2*, and so on, are the filter types, and *val1*, *val2* are the corresponding
|
||||
values, as described in the following table.
|
||||
|
||||
<table>
|
||||
<thead><tr>
|
||||
<th>Filter type</th>
|
||||
<th>Type</th>
|
||||
<th>Description</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>where</td>
|
||||
<td>Object</td>
|
||||
<td>Search criteria. Format: <code>{key: val}</code> or <code>{key: {op: val}}</code>
|
||||
<p>Operations:</p>
|
||||
<ul>
|
||||
<li>gt: ></li>
|
||||
<li>gte: >=</li>
|
||||
<li>lt: <</li>
|
||||
<li>lte: <=</li>
|
||||
<li>between</li>
|
||||
<li>inq: IN</li>
|
||||
<li>nin: NOT IN</li>
|
||||
<li>neq: !=</li>
|
||||
<li>like: LIKE</li>
|
||||
<li>nlike: NOT LIKE</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>include</td>
|
||||
<td>String, Object, or Array</td>
|
||||
<td>Allows you to load relations of several objects and optimize numbers of requests.
|
||||
<p>Format:</p>
|
||||
<ul>
|
||||
<li><code>posts</code>: Load posts</li>
|
||||
<li><code>[posts, passports]</code>: Load posts and passports.</li>
|
||||
<li><code>{owner: posts}</code>: Load owner and owner's posts.</li>
|
||||
<li><code>{owner: [posts, passports]}</code>: Load owner, owner's posts, and owner's passports.</li>
|
||||
<li><code>{owner: [{posts: images}, passports]}</code>: Load owner, owner's posts, owner's posts' images, and owner's passports.</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>order</td>
|
||||
<td>String</td>
|
||||
<td>Sort order. Format: 'key1 ASC, key2 DESC' where ASC specifies ascending and DESC specifies descending order.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>limit</td>
|
||||
<td>Number</td>
|
||||
<td>Maximum number of instances to return.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>skip (offset)</td>
|
||||
<td>Number</td>
|
||||
<td>Skip specified number of instances. Use offset as alternative.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>fields</td>
|
||||
<td>Object, Array, or String</td>
|
||||
<td>The included/excluded fields:
|
||||
<ul>
|
||||
<li>
|
||||
<code>[foo]</code> or <code>foo</code> - include only the foo property.</li>
|
||||
<li>
|
||||
<code>[foo, bar]</code> - include the foo and bar properties</li>
|
||||
<li>
|
||||
<code>{foo: true}</code> - include only foo</li>
|
||||
<li>
|
||||
<code>{bat: false}</code> - include all properties, exclude bat</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
| Filter type | Type | Description |
|
||||
| ------------- | ------------- | ---------------|
|
||||
| where | Object | Search criteria. Format: `{key: val}` or `{key: {op: val}}` For list of valid operations, see Operations, below. |
|
||||
| include | String, Object, or Array | Allows you to load relations of several objects and optimize numbers of requests. For format, see Include format, below. |
|
||||
| order | String | Sort order. Format: 'key1 ASC, key2 DESC', where ASC specifies ascending and DESC specifies descending order. |
|
||||
|limit| Number | Maximum number of instances to return. |
|
||||
|skip (offset) | Number | Skip the specified number of instances. Use offset as alternative. |
|
||||
|fields| Object, Array, or String | The included/excluded fields. For foramt, see fields below.
|
||||
|
||||
**Operations**:
|
||||
- gt: >
|
||||
- gte: >=
|
||||
- lt: <
|
||||
- lte: <=
|
||||
- between
|
||||
- inq: IN
|
||||
- nin: NOT IN
|
||||
- neq: !=
|
||||
- like: LIKE
|
||||
- nlike: NOT LIKE
|
||||
|
||||
**Include 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
|
||||
|
||||
*Fields*:
|
||||
- `['foo']` or `'foo'` - include only the foo property
|
||||
- `['foo', 'bar']` - include the foo and bar properties
|
||||
- `{foo: true}` - include only foo
|
||||
- `{bat: false}` - include all properties, exclude bat
|
||||
|
||||
|
||||
For example,
|
||||
|
||||
|
|
Loading…
Reference in New Issue