From 6505001610f46fc1b4f9e7202725629efa6310d6 Mon Sep 17 00:00:00 2001 From: Wing-Kam Wong Date: Mon, 27 Feb 2023 18:57:26 +0800 Subject: [PATCH] docs: add Comparison Sub-Operators --- .../en/developer-resources/rest-apis.md | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/packages/noco-docs/content/en/developer-resources/rest-apis.md b/packages/noco-docs/content/en/developer-resources/rest-apis.md index 738645d7de..0013557a32 100644 --- a/packages/noco-docs/content/en/developer-resources/rest-apis.md +++ b/packages/noco-docs/content/en/developer-resources/rest-apis.md @@ -221,11 +221,42 @@ Currently, the default value for {orgs} is noco. Users will be able to ch | btw | between | (colName,btw,val1,val2) | | nbtw | not between | (colName,nbtw,val1,val2) | | like | like | (colName,like,%name) | +| isWithin | is Within (Available in `Date` and `DateTime` only) | (colName,isWithin,sub_op) | | allof | includes all of | (colName,allof,val1,val2,...) | | anyof | includes any of | (colName,anyof,val1,val2,...) | | nallof | does not include all of (includes none or some, but not all of) | (colName,nallof,val1,val2,...) | | nanyof | does not include any of (includes none of) | (colName,nanyof,val1,val2,...) | +## Comparison Sub-Operators + +The following sub-operators are available in `Date` and `DateTime` columns. + +| Operation | Meaning | Example | +|-----------------|-------------------------|-----------------------------------| +| today | today | (colName,eq,today) | +| tomorrow | tomorrow | (colName,eq,tomorrow) | +| yesterday | yesterday | (colName,eq,yesterday) | +| oneWeekAgo | one week ago | (colName,eq,oneWeekAgo) | +| oneWeekFromNow | one week from now | (colName,eq,oneWeekFromNow) | +| oneMonthAgo | one month ago | (colName,eq,oneMonthAgo) | +| oneMonthFromNow | one month from now | (colName,eq,oneMonthFromNow) | +| daysAgo | number of days ago | (colName,eq,daysAgo,10) | +| daysFromNow | number of days from now | (colName,eq,daysFromNow,10) | +| exactDate | exact date | (colName,eq,exactDate,2022-02-02) | + +For `isWithin` in `Date` and `DateTime` columns, the different set of sub-operators are used. + +| Operation | Meaning | Example | +|------------------|-------------------------|-----------------------------------------| +| pastWeek | the past week | (colName,isWithin,pastWeek) | +| pastMonth | the past month | (colName,isWithin,pastMonth) | +| pastYear | the past year | (colName,isWithin,pastYear) | +| nextWeek | the next week | (colName,isWithin,nextWeek) | +| nextMonth | the next month | (colName,isWithin,nextMonth) | +| nextYear | the next year | (colName,isWithin,nextYear) | +| nextNumberOfDays | the next number of days | (colName,isWithin,nextNumberOfDays,10) | +| pastNumberOfDays | the past number of days | (colName,isWithin,pastNumberOfDays,10) | + ## Logical Operators | Operation | Example |