Skip to content

Commit ec70c49

Browse files
authored
Merge pull request #309 from nocodb/docs/v3-where-clause
docs: v3 where clause
2 parents 38486ed + dbc70b5 commit ec70c49

File tree

1 file changed

+25
-0
lines changed
  • content/docs/developer-resources/rest-apis

1 file changed

+25
-0
lines changed

content/docs/developer-resources/rest-apis/index.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ You will need an API key and endpoint to use the API. The endpoint URL for hoste
1616

1717
Additional information on the REST APIs is provided below.
1818

19+
- When querying using v3 apis, see [v3 Where Clause](/docs/product-docs/developer-resources/rest-apis#v3-where-query-parameter) for a slight difference between the two version's where clause.
20+
1921
## Query params
2022

2123
| **Name** | **Alias** | **Use case** | **Default value** | **Example value** |
@@ -89,3 +91,26 @@ For `isWithin` in `Date` and `DateTime` columns, the different set of sub-operat
8991
| ~or | (checkNumber,eq,JM555205)~or((amount,gt,200)~and(amount,lt,2000)) |
9092
| ~and | (checkNumber,eq,JM555205)~and((amount,gt,200)~and(amount,lt,2000)) |
9193
| ~not | ~not(checkNumber,eq,JM555205) |
94+
95+
## v3 Where Query Parameter
96+
97+
When calling v3 data api, the where clause has a slight difference with the previous versions. It allows values to be wrapped with quotes (double quotes, single quotes, or backticks) to safely use special characters that might otherwise break older version `where` clauses. This is particularly useful for strings containing commas, parentheses, or other delimiters.
98+
99+
**Example:** Searching for a phrase with special characters:
100+
`("My Field", like, "Let's come home, and go straight to bed")`
101+
102+
**Another Example:** Searching for a value that includes a comma:
103+
`("Product Name", eq, "Laptop, 15-inch")`
104+
105+
**Example:** Using single quotes for a value:
106+
`(City, eq, 'New York')`
107+
108+
### Usage on v2 API
109+
110+
The v3 `where` clause can also be utilized when using the v2 API by prepending the `where` clause with an `@` sign. This allows you to leverage the advanced capabilities of the v3 `where` clause even in v2 API calls.
111+
112+
**Example:** Using a v3 `where` clause to check for non-blank titles in a v2 API call:
113+
`@("Title", not, blank)`
114+
115+
**Another Example:** Combining multiple conditions with special characters in a v2 API call:
116+
`@("Description", like, "High-performance, water-resistant")`

0 commit comments

Comments
 (0)