Skip to content
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

Fixes for summarize and aggregate docs #350

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions 040-Data-operations/121-summarize.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ Sort lets you decide how you'd like your results sorted. You may sort on `column
<TabbedCode tabs={['TypeScript', 'Python', 'Go', 'SQL', 'JSON']}>
```ts
const records = await xata.db.sales.summarize({
columns: {"store_name"},
columns: ["store_name"],
summaries: {
"total_sales": {"count": "*"}
},
Expand All @@ -486,7 +486,7 @@ Sort lets you decide how you'd like your results sorted. You may sort on `column

```python
records = xata.data().summarize("sales", {
"columns": {"store_name"},
"columns": ["store_name"],
"summaries": {
"total_sales": {"count": "*"}
},
Expand Down Expand Up @@ -531,15 +531,15 @@ records, _ := searchClient.Summarize(context.TODO(), xata.SummarizeTableRequest{
```jsonc
// POST https://{workspace}.{region}.xata.sh/db/{db}:{branch}/tables/{table}/summarize
{
"columns": {"store_name"},
"columns": ["store_name"],
"summaries": {
"total_sales": {"count": "*"}
"total_sales": { "count": "*" }
},
"sort": [
// put the highest total_sales at the top
{"total_sales": "desc"},
{ "total_sales": "desc" },
// if total_sales is equal for two rows, order them by the store_name
{"store_name": "asc"}
{ "store_name": "asc" }
]
}
```
Expand All @@ -552,7 +552,7 @@ Page lets you determine how many results are returned. We currently only support

The default setting for `size` , if not specified in the request, is 20 results. We allow you to set this between 1 and 1000.

If this limitation is too small, we ask that you move your workload to the [aggregate](/docs/sdk/aggregate) endpoint which does not have such limitations.
If this limitation is too small, check if a similar request can be achieved using the [aggregate](/docs/sdk/aggregate) endpoint as an alternative approach.

An example of a page request looks like:

Expand Down
Loading