Skip to content

Commit 3a3cac3

Browse files
authored
Update 2.search.md
1 parent 52ff26f commit 3a3cac3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

content/2.endpoints/2.search.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Here is a quick look at what you can do:
5858
"relation": "stars",
5959
"type": "max",
6060
"field": "rate",
61-
"alias": "approved_max_rate",
61+
"alias": "approved_max_stars",
6262
"filters": [
6363
{"field": "approved", "value": true}
6464
]
@@ -105,7 +105,7 @@ Here is a quick look at what you can do:
105105
| `aggregates.relation` | `string` | X | | The relation you are querying |
106106
| `aggregates.type` | `string` | X | | The type of the aggregates you want to use in: `min`, `max`, `avg`, `sum`, `count` and `exists` |
107107
| `aggregates.field` | `string` | when type is not `exists` or `count` | `*` | The field you want to execute your aggregate on |
108-
| `aggregates.alias` | `string` | | | The name to use for the aggregate column in the response |
108+
| `aggregates.alias` | `string` | | | The alias given for the aggregate |
109109
| `aggregates.filters` | `array` | | | You can specify all the arguments for the `filters` section |
110110
| **Instructions** | | | | |
111111
| `instructions.name` | `string` | X | | The instruction `uriKey` |
@@ -420,7 +420,7 @@ For the `exists` and `count` operation you must not specify the field since thes
420420

421421
### Aliases
422422

423-
You may optionally define an alias for your aggregate using the alias method. This allows you to customize the name of the aggregate column in the response, instead of relying on Laravel's default naming.
423+
You may optionally define an alias for your aggregate using the `alias` method. This allows you to customize the name of the aggregate column in the response, instead of relying on Laravel's default naming.
424424

425425
```json
426426
// (POST) api/posts/search
@@ -431,7 +431,7 @@ You may optionally define an alias for your aggregate using the alias method. Th
431431
"relation": "comments",
432432
"type": "avg",
433433
"field": "stars",
434-
"alias": "stars_average"
434+
"alias": "average_stars"
435435
}
436436
]
437437
}

0 commit comments

Comments
 (0)