-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Time and datetime improvements, add boolean and none/null page (#449)
- Loading branch information
Showing
15 changed files
with
173 additions
and
90 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
doc-surrealdb_versioned_docs/version-1.x/surrealql/datamodel/booleans.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
sidebar_position: 3 | ||
sidebar_label: Booleans | ||
title: Booleans | SurrealQL | ||
description: Boolean values in SurrealDB can be used to mark whether a field is true or false | ||
|
||
--- | ||
|
||
## Booleans | ||
Boolean values can be used to mark whether a field is `true` or `false`. | ||
|
||
```surql | ||
CREATE person SET newsletter = false, interested = true; | ||
``` | ||
|
||
Many SurrealDB operators and functions return booleans. | ||
|
||
```surql | ||
CREATE person SET | ||
name = "Billy", | ||
name_is_billy = name = "Billy", | ||
name_is_long = string::len(name) > 10; | ||
``` | ||
|
||
```bash title="Response" | ||
[ | ||
{ | ||
"id": "person:8ii7v7f54a2m1rla1y6b", | ||
"name": "Billy", | ||
"name_is_billy": true, | ||
"name_is_long": false | ||
} | ||
] | ||
``` | ||
|
||
Boolean values can be written in anycase. | ||
|
||
```surql | ||
CREATE person SET | ||
newsletter = FALSE, | ||
interested = True, | ||
very_interested = trUE; | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
doc-surrealdb_versioned_docs/version-1.x/surrealql/datamodel/formatters.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
doc-surrealdb_versioned_docs/version-1.x/surrealql/datamodel/futures.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
doc-surrealdb_versioned_docs/version-1.x/surrealql/datamodel/geometries.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
doc-surrealdb_versioned_docs/version-1.x/surrealql/datamodel/ids.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
doc-surrealdb_versioned_docs/version-1.x/surrealql/datamodel/none_and_null.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
sidebar_position: 9 | ||
sidebar_label: None and Null | ||
title: None and Null | SurrealQL | ||
description: SurrealDB uses two types called None and Null to represent two different ways in which data may not exist. | ||
|
||
--- | ||
|
||
# None and null | ||
|
||
SurrealDB uses two types called None and Null to represent two different ways in which data may not exist. | ||
|
||
## None values | ||
Values can be specifically set to `NONE` in SurrealDB to remove a field from a record. | ||
|
||
```surql | ||
CREATE person SET children = NONE; | ||
``` | ||
The `NONE` keyword can be written in anycase. | ||
|
||
```surql | ||
CREATE person SET children = NONE, siblings = none; | ||
``` | ||
|
||
## Null values | ||
Values can be specifically set to `NULL` in SurrealDB to denote a field which is set, but which does not have a value. | ||
|
||
```surql | ||
CREATE person SET children = NULL; | ||
``` | ||
The `NULL` keyword can be written in anycase. | ||
|
||
```surql | ||
CREATE person SET children = NULL, siblings = null; | ||
``` | ||
|
||
|
2 changes: 1 addition & 1 deletion
2
doc-surrealdb_versioned_docs/version-1.x/surrealql/datamodel/numbers.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
doc-surrealdb_versioned_docs/version-1.x/surrealql/datamodel/objects.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
doc-surrealdb_versioned_docs/version-1.x/surrealql/datamodel/simple.mdx
This file was deleted.
Oops, something went wrong.
79 changes: 65 additions & 14 deletions
79
...ion-1.x/surrealql/datamodel/datetimes.mdx → .../version-1.x/surrealql/datamodel/time.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.