-
Notifications
You must be signed in to change notification settings - Fork 12
Document countOnly parameter and count security rule type #217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a471bbd
69ddcd1
a13b7e8
cf2615b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -82,7 +82,7 @@ curl -X GET \ | |
|
|
||
| ## Data source access | ||
|
|
||
| Data sources requires access to be accessed to. Roles can have multiple permissions: **read, write, update, delete**. Once you create a data source, permissions need to be assigned to it. | ||
| Data sources require access to be used. Roles can have multiple permissions: **read, write, update, delete, count**. Once you create a data source, permissions need to be assigned to it. | ||
|
|
||
| If an API token you're using doesn't have access to one of your organization data sources, you will need to grant permissions to it via Fliplet Studio: | ||
|
|
||
|
|
@@ -425,6 +425,7 @@ All operators of the [Data Source "find" JS API](https://developers.fliplet.com/ | |
| - [limit](https://developers.fliplet.com/API/fliplet-datasources.html#fetch-records-with-pagination) - Limit number of results | ||
| - [offset](https://developers.fliplet.com/API/fliplet-datasources.html#fetch-records-with-pagination) - Skip records for pagination | ||
| - [includePagination](https://developers.fliplet.com/API/fliplet-datasources.html#pagination-and-performance) - Include pagination metadata | ||
| - [countOnly](https://developers.fliplet.com/API/fliplet-datasources.html#count-records-only) - Return count without entry data | ||
tonytlwu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| #### Basic Query Example | ||
|
|
||
|
|
@@ -502,6 +503,35 @@ Response (Status code: 200 OK): | |
| } | ||
| ``` | ||
|
|
||
| #### Count Only Query | ||
|
|
||
| To retrieve just the count of matching entries without the actual data, use `countOnly: true`: | ||
|
|
||
| Request body (JSON): | ||
|
|
||
| ```json | ||
tonytlwu marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| "where": { | ||
| "SessionId": "123" | ||
| }, | ||
| "countOnly": true | ||
| } | ||
|
Comment on lines
+516
to
+518
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove trailing spaces. Static analysis detects trailing whitespace on these lines within or around the code block. 🧹 Cleanup requiredRemove any trailing spaces from lines 516-518 to satisfy markdownlint. 🧰 Tools🪛 markdownlint-cli2 (0.18.1)516-516: Trailing spaces (MD009, no-trailing-spaces) 517-517: Trailing spaces (MD009, no-trailing-spaces) 518-518: Trailing spaces (MD009, no-trailing-spaces) 🤖 Prompt for AI Agents |
||
| ``` | ||
|
|
||
| Response (Status code: 200 OK): | ||
|
|
||
| ```json | ||
| { | ||
| "count": 42, | ||
| "dataSourceId": 123 | ||
| } | ||
| ``` | ||
|
|
||
| **Notes:** | ||
| - Requires `count` or `select` permission in security rules | ||
| - The `select` permission automatically grants `count` permission | ||
| - Simple filters use fast database `COUNT(*)`, complex filters use Sift.js fallback | ||
|
|
||
| #### Advanced Query with Complex Filters | ||
|
|
||
| For detailed information on all available query operators including MongoDB-style operators and Fliplet's custom `$filters` operator, see the [Query Operators Reference](../API/datasources/query-operators.html). | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.