Browse Source

docs: update query params & operators

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>
pull/1700/head
Wing-Kam Wong 3 years ago
parent
commit
88b5bea21f
  1. 59
      packages/noco-docs/content/en/developer-resources/rest-apis.md

59
packages/noco-docs/content/en/developer-resources/rest-apis.md

@ -153,8 +153,6 @@ Here's the overview of all APIs. For the details, please check out <a href="http
| Meta | Get | utils | appInfo | /api/v1/db/meta/nocodb/info | | Meta | Get | utils | appInfo | /api/v1/db/meta/nocodb/info |
| Meta | Get | utils | appVersion | /api/v1/db/meta/nocodb/version | | Meta | Get | utils | appVersion | /api/v1/db/meta/nocodb/version |
<!-- TODO: verify -->
## Query params ## Query params
| **Name** | **Alias** | **Use case** | **Default value** |**Example value** | | **Name** | **Alias** | **Use case** | **Default value** |**Example value** |
@ -164,6 +162,8 @@ Here's the overview of all APIs. For the details, please check out <a href="http
| offset | o | Offset for pagination(SQL offset value) | 0 | 20 | | offset | o | Offset for pagination(SQL offset value) | 0 | 20 |
| sort | s | Sort by column name, Use `-` as prefix for descending sort | | column_name | | sort | s | Sort by column name, Use `-` as prefix for descending sort | | column_name |
| fields | f | Required column names in result | * | column_name1,column_name2 | | fields | f | Required column names in result | * | column_name1,column_name2 |
<!--
| fields1 | f1 | Required column names in child result | * | column_name1,column_name2 | | fields1 | f1 | Required column names in child result | * | column_name1,column_name2 |
| bt | | Comma-separated belongs to tables | `All belongs to tables` | [click here for example](#nested-parentbelongs-to) | | bt | | Comma-separated belongs to tables | `All belongs to tables` | [click here for example](#nested-parentbelongs-to) |
| bfields`<p>` | bf`<p>` | Required belongs to table column names in result. Where `<p>` refers to position of table name in `bt` parameter(starts from `1`) | primary key and primary value | [click here for example](#nested-parentbelongs-to) | | bfields`<p>` | bf`<p>` | Required belongs to table column names in result. Where `<p>` refers to position of table name in `bt` parameter(starts from `1`) | primary key and primary value | [click here for example](#nested-parentbelongs-to) |
@ -171,32 +171,29 @@ Here's the overview of all APIs. For the details, please check out <a href="http
| hfields`<p>` | hf`<p>` | Required has many table column names in result. Where `<p>` refers to position of table name in `hm` parameter(starts from `1`) | primary key and primary value | [click here for example](#nested-childrenhas-many) | | hfields`<p>` | hf`<p>` | Required has many table column names in result. Where `<p>` refers to position of table name in `hm` parameter(starts from `1`) | primary key and primary value | [click here for example](#nested-childrenhas-many) |
| mm | | Comma-separated many to many tables | `All many to many tables` | [click here for example](#nested-childrenmany-to-many) | | mm | | Comma-separated many to many tables | `All many to many tables` | [click here for example](#nested-childrenmany-to-many) |
| mfields`<p>` | mf`<p>` | Required many to many table column names in result. Where `<p>` refers to position of table name in `mm` parameter(starts from `1`) | primary key and primary value | [click here for example](#nested-childrenmany-to-many) | | mfields`<p>` | mf`<p>` | Required many to many table column names in result. Where `<p>` refers to position of table name in `mm` parameter(starts from `1`) | primary key and primary value | [click here for example](#nested-childrenmany-to-many) |
-->
## Comparison operators
## Comparison Operators
```
eq - '=' - (colName,eq,colValue) | Operation | Meaning | Example |
not - '!=' - (colName,not,colValue) |---|---|---|
gt - '>' - (colName,gt,colValue) | eq | equal | (colName,eq,colValue) |
ge - '>=' - (colName,ge,colValue) | not | not equal | (colName,not,colValue) |
lt - '<' - (colName,lt,colValue) | gt | greater than | (colName,gt,colValue) |
le - '<=' - (colName,le,colValue) | ge | greater or equal | (colName,ge,colValue) |
is - 'is' - (colName,is,true/false/null) | lt | less than | (colName,lt,colValue) |
isnot - 'is not' - (colName,isnot,true/false/null) | le | less or equal | (colName,le,colValue) |
in - 'in' - (colName,in,val1,val2,val3,val4) | is | is | (colName,is,true/false/null) |
btw - 'between' - (colName,btw,val1,val2) | isnot | is not | (colName,isnot,true/false/null) |
nbtw - 'not between'- (colName,nbtw,val1,val2) | in | in | (colName,in,val1,val2,val3,val4) |
like - 'like' - (colName,like,%name) | btw | between | (colName,btw,val1,val2) |
``` | nbtw | not between | (colName,nbtw,val1,val2) |
| like | like | (colName,like,%name) |
#### Example use of comparison operators - complex example
``` ## Logical Operators
<API_PATH>?where=(checkNumber,eq,JM555205)~or((amount,gt,200)~and(amount,lt,2000))
``` | Operation | Example |
|---|---|
#### Logical operators | ~or | (checkNumber,eq,JM555205)~or((amount, gt, 200)~and(amount, lt, 2000)) |
``` | ~and | (checkNumber,eq,JM555205)~and((amount, gt, 200)~and(amount, lt, 2000)) |
~or - 'or' | ~not | ~not(checkNumber,eq,JM555205) |
~and - 'and'
~not - 'not'
```
Loading…
Cancel
Save