Skip to content

Commit c86e869

Browse files
committed
Rearranged page order and updated example snippet formatting
1 parent 8180c37 commit c86e869

File tree

29 files changed

+845
-360
lines changed

29 files changed

+845
-360
lines changed

examples/node/v12/__tests__/realm-query-language.test.ts

Lines changed: 165 additions & 97 deletions
Large diffs are not rendered by default.

source/examples/generated/node/v12/formatted/realm-query-language.test.snippet.backlinks-aggregate-operators.ts.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
.. code-block:: typescript
22
3-
// Find items that belong to a project with a quota
4-
// less than 10 (using '@links').
3+
// Find items that belong to a project with a quota less than 10
4+
// (using '@links.<ObjectType>.<PropertyName>').
55
"@links.Project.items.quota < 10"
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
.. code-block:: typescript
22
3-
// Find items where ANY project that references the item
4-
// has a quota greater than 10.
5-
"ANY @links.Project.items.quota > 10"
6-
// Find items where ALL projects that reference the item
7-
// have a quota less than 5.
8-
"ALL @links.Project.items.quota < 5"
3+
// Find items where no project that references the item
4+
// has a quota greater than 10.
5+
"NONE @links.Project.items.quota > 10"
6+
7+
// Find items where all projects that reference the item
8+
// have a quota less than 5.
9+
"ALL @links.Project.items.quota < 5"
10+
11+
// Find items that are referenced by multiple projects.
12+
"projects.@count > 1"
13+
14+
// Find items that are not referenced by any project.
15+
"@links.Project.items.@count == 0"
16+
17+
// Find items that belong to a project where the average item has
18+
// been worked on for at least 10 minutes
19+
20+
21+
// Find items that are not referenced by another
22+
// object of any type (backlink count is 0).
23+
"@links.@count == 0"
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.. code-block:: typescript
22
33
// Find items that belong to a project with a quota greater than 10
4+
// through the Item object's `projects` property
45
// (using 'LinkingObjects').
56
"projects.quota > 10"
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
.. code-block:: typescript
22
3-
// Find items with a `priority` greater than 3.
4-
"2 * priority > 6" // `priority > 3`
5-
"priority >= 2 * (2 - 1) + 2" // `priority >= 4`
3+
// Evaluate against an item's `priority` property value:
4+
"2 * priority > 6" // resolves to `priority > 3`
5+
"priority >= 2 * (2 - 1) + 2" // resolves to `priority >= 4`
6+
7+
// Evaluate against multiple object property values:
8+
"progressMinutes * priority == 90"

source/examples/generated/node/v12/formatted/realm-query-language.test.snippet.comparison-operators.ts.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// Compare `priority` values against a threshold value.
44
"priority > $0", 5
55
6-
// Compare `progressMinutes` values against a threshold value.
7-
"progressMinutes > $0", 120
8-
96
// Compare `assignee` values to `null` value.
107
"assignee == $0", null
118

source/examples/generated/node/v12/formatted/realm-query-language.test.snippet.date-parameterized-query.ts.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@
33
// Find to-do items completed before today's date.
44
"dateCompleted < $0", today
55
6-
// Find to-do items completed this year until today.
6+
// Find to-do items completed between the start of the year
7+
// until today.
78
"dateCompleted > $0 AND dateCompleted < $1", thisYear, today
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
.. code-block:: typescript
22
3+
// Find projects whose `projectLocation` property contains
4+
// an embedded Address object with a specific zip code.
35
"projectLocation.address.zipcode == 10019"
Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
.. code-block:: typescript
22
3-
// Find `comments` dictionary properties with key 'status'.
3+
// Find projects whose `comments` dictionary property
4+
// have a key of 'status'.
45
"comments.@keys == $0", "status"
56
6-
// Find `comments` dictionary properties with key 'status'
7-
// and value 'On track'.
8-
"comments['status'] == $0", "On track"
9-
// Find `comments` dictionary properties with
10-
// more than one key-value pair.
11-
"comments.@count > $0", 1
7+
// Find projects whose `comments` dictionary property
8+
// have a 'status' key with a value that ends in 'track'.
9+
"comments['status'] LIKE $0", "*track"
1210
13-
// Find `comments` dictionary properties where ANY
14-
// values are of type 'string`.
15-
"ANY comments.@type == 'string'"
16-
"comments.@type == 'string'" // (Equivalent - ANY is implied.)
11+
// Find projects whose `comments` dictionary property
12+
// have more than one key-value pair.
13+
"comments.@count > $0", 1
1714
18-
// Find `comments` dictionary properties where ALL
19-
// values are of type 'int'.
20-
"ALL comments.@type == 'int'"
15+
// Find projects whose `comments` dictionary property
16+
// contains only values of type 'string'.
17+
"ALL comments.@type == 'string'"
2118
22-
// Find `comments` dictionary properties where NO
23-
// values are of type 'int'.
19+
// Find projects whose `comments` dictionary property
20+
// contains no values of type 'int'.
2421
"NONE comments.@type == 'int'"
25-

0 commit comments

Comments
 (0)