Skip to content
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
21 changes: 10 additions & 11 deletions cds/cxl.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ An expression can hold various elements, such as references, literals, function
```cds
select from Books {
42 as answer, // literal
title, // reference ("ref")
title, // element reference
price * quantity as totalPrice, // binary operator
substring(title, 1, 3) as shortTitle, // function call
author.name as authorName, // ref with path expression
author.name as authorName, // path expression
chapters[number < 3] as earlyChapters, // ref with infix filter
exists chapters as hasChapters, // exists
count(chapters) as chapterCount, // aggregate function
Expand Down Expand Up @@ -288,7 +288,7 @@ They typically manifest as columns in database tables.

### Simple Element Reference

In its simplest form, a `ref` can be used to reference an element:
The simplest form of a `ref` references a single element:

:::code-group
```js [CQL] {1}
Expand All @@ -312,7 +312,7 @@ In this example, we select the `title` element from the `Books` entity.

### Path Navigation

A path expression can be used to navigate to any element of the associations target:
A path expression navigates to elements of an association's target:

:::code-group
```js [CQL]
Expand Down Expand Up @@ -420,7 +420,7 @@ To achieve this, use the [exists](#in-exists-predicates) predicate.
Path expressions can also be used after the `exists` keyword to check whether the set referenced by the path is empty.
This is especially useful for to-many relations.

E.g., to select all authors that have written **at least** one book:
For example, to select all authors that have written **at least** one book:

:::code-group
```js [CQL]
Expand Down Expand Up @@ -455,8 +455,8 @@ This allows you to specify conditions on subsets of associated entities, enablin

An infix in linguistics refers to a letter or group of letters that are added in the middle of a word to make a new word.

If we apply this terminology to [path-expressions](#ref), an infix filter condition is an expression
that is applied to a path-segment of a [path-expression](#ref).
If we apply this terminology to path expressions, an infix filter condition is an expression
that is applied to a path segment of a path expression.
This allows you to filter the target of an association based on certain criteria.

![](assets/cxl/infix-filter.drawio.svg?raw)
Expand All @@ -470,8 +470,7 @@ This allows you to filter the target of an association based on certain criteria




### Applied to `exists` predicate { #exists-infix-filter }
### Applied to `exists` Predicate { #exists-infix-filter }

In this example, we want to select all authors with books that have a certain stock amount.
To achieve this, we can apply an infix filter to the path segment `books` in the exists predicate:
Expand Down Expand Up @@ -527,7 +526,7 @@ WHERE exists (
:::


### Applied to `from` clause
### Applied to `from` Clause

Infix filters can also be applied to [path expressions in the `from` clause](./cql#path-expressions-in-from-clauses).

Expand Down Expand Up @@ -620,7 +619,7 @@ In the `Authors` entity in the `Books.cds` file add a new element `cheapBooks`:
```

Now we can use `cheapBooks` just like any other association.
E.g. to select the set of authors which have no cheap books:
For example, to select the set of authors which have no cheap books:

:::code-group
```js [CQL]
Expand Down