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

Tweak formatting on SurrealQL ranges documentation #967

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions src/content/doc-surrealql/datamodel/ranges.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,26 @@ A range is composed of `..` and possible delimiters to set the maximum and minim
-- From 0 up to 9
0..10;
-- From 0 up to 10
0..=10
0..=10;
-- From 1 to 9
0>..10;
-- From 1 to 10
0>..=10
0>..=10;
```

A range becomes open ended if a delimiter is not specified.

```surql
-- Anything from 0 and up
0..
0..;
-- Anything from 1 and up
0>..
0>..;
-- Anything up to 99
..100
..100;
-- Anything up to 100
..=100
..=100;
-- An infinite range
..
..;
```

A range can be constructed from any type of value. This is most useful when comparing one value to another.
Expand Down Expand Up @@ -71,7 +71,7 @@ FOR $year IN 0..=2024 {
A range can be cast into an array.

```surql
<array>1..3;
<array> 1..3;
```

```surql title="Output"
Expand All @@ -85,7 +85,7 @@ This opens up a range of functional programming patterns that are made possible

```surql
-- Construct an array
(<array>1..=100)
(<array> 1..=100)
-- Turn it into an array that increments by 10
.map(|$v| $v * 10)
-- Turn each number into a object with original and square root value
Expand Down