Skip to content

Commit 3a9e835

Browse files
Merge branch cypher-25 into dev
2 parents e52ae7a + 956ac9e commit 3a9e835

File tree

17 files changed

+435
-67
lines changed

17 files changed

+435
-67
lines changed

.github/workflows/docs-pr-checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- 'main'
99
- '5.x'
1010
- '4.4'
11+
- 'cypher-25'
1112

1213
jobs:
1314

models/hospital/access-control-old.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55

66
When creating a database, administrators may want to establish which users have the ability to access certain information.
77

8+
<<<<<<< HEAD
89
As described in xref:authentication-authorization/built-in-roles.adoc[Built-in roles], Neo4j already offers preset roles configured to specific permissions (i.e. read, edit, or write).
10+
=======
11+
As described in xref:authentication-authorization/built-in-roles/auth-built-in-roles[Built-in roles], Neo4j already offers preset roles configured to specific permissions (i.e. read, edit, or write).
12+
>>>>>>> cypher-25
913
While these built-in roles cover many common daily scenarios, it is also possible to create custom roles for specific needs.
1014
1115
This page contains an example that illustrates various aspects of security and fine-grained access control.

modules/ROOT/pages/authentication-authorization/database-administration.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ Use `REVOKE` if you want to remove a privilege.
179179
====
180180

181181
Common errors, such as misspellings or attempts to revoke privileges that have not been granted or denied, will lead to notifications.
182-
Some of these notifications may be replaced with errors in a future major version of Neo4j.
182+
In Cypher 25, notifications for impossible `REVOKE` commands, where a user, a role, or a database does not exist, have been replaced with errors.
183183
See link:{neo4j-docs-base-uri}/status-codes/{page-version}/notifications/all-notifications[Status Codes for Errors & Notifications -> Server notifications] for details on notifications.
184184

185185
The hierarchy between the different database privileges is shown in the image below.

modules/ROOT/pages/authentication-authorization/manage-privileges.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ Use `REVOKE` if you want to remove a privilege.
197197
====
198198

199199
Common errors, such as misspellings or attempts to revoke privileges that have not been granted or denied, will result in notifications.
200-
Some of these notifications may be replaced with errors in a future major version of Neo4j.
200+
In Cypher 25, notifications for impossible `REVOKE` commands, where a user, a role, or a database does not exist, have been replaced with errors.
201201
See link:{neo4j-docs-base-uri}/status-codes/{page-version}/notifications/all-notifications[Status Codes -> Notification codes] for details on notifications.
202202

203203
The general `GRANT` and `DENY` syntaxes are illustrated in the following image:

modules/ROOT/pages/authentication-authorization/manage-roles.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -814,7 +814,7 @@ REVOKE ROLES role1, role2 FROM user1, user2, user3
814814
----
815815

816816
Common errors, such as misspellings or attempts to revoke roles from users who have not been granted those roles, will lead to notifications.
817-
Some of these notifications may be replaced with errors in a future major version of Neo4j.
817+
In Cypher 25, notifications for impossible `REVOKE` commands, where a user, a role, or a database does not exist, have been replaced with errors.
818818
See link:{neo4j-docs-base-uri}/status-codes/{page-version}/notifications/all-notifications[Status Codes -> Notification codes] for details on notifications.
819819

820820
[[access-control-drop-roles]]

modules/ROOT/pages/backup-restore/online-backup.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,14 @@ bin/neo4j-admin database backup --to-path=azb://myStorageAccount/myContainer/myD
465465
[[diff-backup-as-parent]]
466466
=== Perform a differential backup using the `--prefer-diff-as-parent` option
467467

468-
By default, a differential backup (`--type=DIFF`) uses the *most recent non-empty* backup -- whether full or differential -- in the directory as its parent.
468+
By default, a differential backup (`--type=DIFF`) uses the *most recent non-empty* backup -- whether full or differential -- in the directory as its parent.
469469

470-
The `--prefer-diff-as-parent` option changes this behavior and forces the backup job to use the *latest differential* backup as the parent, even if a newer full backup exists.
470+
The `--prefer-diff-as-parent` option changes this behavior and forces the backup job to use the *latest differential* backup as the parent, even if a newer full backup exists.
471471

472472
This approach allows you to maintain a chain of differential backups for all transactions and restore to any point in time.
473473
Without this option, the transactions between the last full backup and a previous differential backup cannot be backed up as individual transactions.
474474

475-
To use the `--prefer-diff-as-parent` option, set it to `true`.
475+
To use the `--prefer-diff-as-parent` option, set it to `true`.
476476

477477
The following examples cover different scenarios for using the `--prefer-diff-as-parent` option.
478478

modules/ROOT/pages/backup-restore/restore-backup.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ For more information, see xref:database-administration/standard-databases/create
2323
[NOTE]
2424
====
2525
If you are using CDC, make sure you create the new database with the same `txLogEnrichment` value and handle the potential loss or corruption of CDC data in your CDC application.
26-
For more information, see the link:https://neo4j.com/docs/cdc/current/[Change Data Capture (CDC)] documentation.
26+
27+
For more information, see the link:{neo4j-docs-base-uri}/cdc/{page-version}[Change Data Capture (CDC)] documentation.
2728
====
2829

2930
[NOTE]

modules/ROOT/pages/changes-deprecations-removals.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ Replaced by: xref:procedures.adoc#procedure_dbms_cluster_secondaryReplicationDis
475475
| Comment
476476
477477
| xref:configuration/configuration-settings.adoc#config_dbms.routing.load_balancing.plugin[`dbms.routing.load_balancing.plugin`]
478-
|
478+
|
479479
| {check-mark}
480480
| label:deprecated[Deprecated in 2025.05]
481481

modules/ROOT/pages/database-administration/standard-databases/create-databases.adoc

Lines changed: 136 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ For more information, see link:{neo4j-docs-base-uri}/upgrade-migration-guide/upg
1919
== Create databases
2020

2121
You can create a database using the Cypher command `CREATE DATABASE`.
22+
The initial contents of the database depend on the state of the server and the options provided to the command.
23+
When no additional options are provided, `CREATE DATABASE` will attempt to mount any pre-existing store files in place (e.g., as the result of restoring a backup).
24+
If no pre-existing store files are available, it will create an empty database.
2225

2326
[NOTE]
2427
====
@@ -36,6 +39,11 @@ See xref:database-internals/store-formats.adoc[Store formats], for more details
3639

3740
=== Syntax
3841

42+
[options="header", width="100%", cols="1m,5a"]
43+
[.tabbed-example]
44+
=====
45+
[role=include-with-Cypher-5]
46+
======
3947
[options="header", width="100%", cols="1m,5a"]
4048
|===
4149
| Command | Syntax
@@ -57,13 +65,47 @@ CREATE OR REPLACE DATABASE name
5765
[OPTIONS "{" option: value[, ...] "}"]
5866
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
5967
----
68+
|===
69+
70+
======
6071
72+
[role=include-with-Cypher-25]
73+
======
74+
75+
[options="header", width="100%", cols="1m,5a"]
76+
|===
77+
| Command | Syntax
78+
| CREATE DATABASE
79+
|
80+
[source, syntax, role="noheader"]
81+
----
82+
CREATE DATABASE name [IF NOT EXISTS]
83+
[[SET] TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]]
84+
[OPTIONS "{" option: value[, ...] "}"]
85+
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
86+
----
87+
88+
[source, syntax, role="noheader"]
89+
----
90+
CREATE OR REPLACE DATABASE name
91+
[[SET] TOPOLOGY n PRIMAR{Y\|IES} [m SECONDAR{Y\|IES}]]
92+
[OPTIONS "{" option: value[, ...] "}"]
93+
[WAIT [n [SEC[OND[S]]]]\|NOWAIT]
94+
----
6195
|===
6296

97+
======
98+
=====
99+
63100

64101
[[manage-databases-create-database-options]]
65102
=== Options
66103

104+
[.tabbed-example]
105+
=====
106+
[.include-with-cypher-5]
107+
======
108+
67109
The `CREATE DATABASE` command can have a map of options, e.g. `OPTIONS {key: 'value'}`.
68110

69111
[options="header"]
@@ -128,7 +170,70 @@ Starting from Neo4j 2025.01, you can use `existingData`, `seedURI`, `seedConfig`
128170
The `existingDataSeedInstance` and `existingDataSeedServer` are still not supported with the `CREATE OR REPLACE DATABASE` command.
129171
More details about seeding options can be found in xref::clustering/databases.adoc#cluster-seed[Seed a cluster].
130172
====
173+
======
174+
[.include-with-cypher-25]
175+
======
176+
The `CREATE DATABASE [OR REPLACE]` command can have a map of options, e.g., `OPTIONS {key: 'value'}`.
131177

178+
[options="header"]
179+
|===
180+
181+
| Key | Value | Description
182+
183+
|`existingDataSeedServer`
184+
| ID of the cluster server
185+
|
186+
Defines which server is used for seeding the data of the created database.
187+
The server ID can be found in the `serverId` column after running `SHOW SERVERS`.
188+
189+
| `seedURI`
190+
| URI to a backup, a folder that contains backup artifacts or a dump from an existing database.
191+
|
192+
Defines a seed from an external source, which will be used to seed all servers.
193+
194+
| `seedConfig`
195+
| Comma-separated list of configuration values.
196+
|
197+
For more information see xref::clustering/databases.adoc#cluster-seed-uri[Seed from URI].
198+
199+
| `txLogEnrichment`
200+
| `FULL` \| `DIFF` \| `OFF`
201+
|
202+
Defines the level of enrichment applied to transaction logs for Change Data Capture (CDC) purposes.
203+
204+
For details about enrichment mode, see link:{neo4j-docs-base-uri}/cdc/current/get-started/self-managed/#set-enrichment-mode/[Change Data Capture Manual -> Enable CDC on self-managed instances -> Set the enrichment mode].
205+
206+
| `storeFormat`
207+
| `aligned` \| `standard` \| `high_limit` \| `block`
208+
|
209+
Defines the store format if the database created is new.
210+
`high_limit` and `standard` formats are deprecated from 5.23.
211+
For more information on store formats, see xref::database-internals/store-formats.adoc[Store formats].
212+
213+
If the store is seeded with `seedURI` or `existingDataSeedServer`, or if the command is used to mount pre-existing store files already present on the disk, they will retain their current store format without any modifications.
214+
215+
| `seedRestoreUntil`
216+
| Datetime or transaction id. E.g. `datetime("2025-01-01T12:15:00.000+0100")` or `123456`
217+
|
218+
If you are passing a `seedURI` that leads to a backup chain, including differential backups, you can choose to not apply all the transactions in the differential backups.
219+
To seed up to a specific date, specify a `datetime`.
220+
This will seed the database with transactions committed before the provided timestamp.
221+
To seed up to a specific transaction ID, specify a transaction ID.
222+
This will seed the database with transactions up to, but not including the specified transaction.
223+
224+
| `seedSourceDatabase`
225+
| A source database name
226+
|
227+
If the `seedURI` points to a folder containing backups for multiple databases, you can specify the database name to filter the artifacts.
228+
229+
| `existingData` label:deprecated[Deprecated]
230+
| `use`
231+
|
232+
Included for backward compatibility only, has no effect and will be removed in a future version.
233+
234+
|===
235+
======
236+
=====
132237

133238
=== Examples
134239

@@ -164,7 +269,11 @@ SHOW DATABASES YIELD name
164269

165270
==== Create a database with xref:database-administration/standard-databases/wait-options.adoc[`WAIT`]
166271

167-
Sub-clause `WAIT` allows you to specify a time limit in which the command must complete and return.
272+
[.tabbed-example]
273+
=====
274+
[.include-with-cypher-5]
275+
======
276+
Sub-clause `WAIT` allows you to specify a time limit for the command to complete and return.
168277

169278
[source, cypher]
170279
----
@@ -183,7 +292,33 @@ CREATE DATABASE slow WAIT 5 SECONDS
183292

184293
The `success` column provides an aggregate status of whether or not the command is considered successful.
185294
Thus, every row has the same value, determined on a successful completion without a timeout.
295+
======
296+
[.include-with-cypher-25]
297+
======
298+
Sub-clause `WAIT` allows you to specify a time limit for the command to complete and return.
299+
300+
[source, cypher]
301+
----
302+
CREATE DATABASE slow WAIT 5 SECONDS
303+
----
304+
305+
.Result
306+
[role="queryresult"]
307+
----
308+
info: Server `ServerId{b55c6551}` at address `server1:7687` has caught up.
309+
03N85 (Neo.ClientNotification.Cluster.ServerCaughtUp)
310+
311+
info: Server `ServerId{a9e7e8f1}` at address `server2:7687` has caught up.
312+
03N85 (Neo.ClientNotification.Cluster.ServerCaughtUp)
313+
314+
info: Server `ServerId{0f7cb48e}` at address `server3:7687` has caught up.
315+
03N85 (Neo.ClientNotification.Cluster.ServerCaughtUp)
316+
----
186317

318+
The command returns a notification for each server in the cluster to indicate the status of that command on that server.
319+
In this example, all three cluster members have returned `Neo.ClientNotification.Cluster.ServerCaughtUp`, which indicates that the server has applied the command successfully and is up to date.
320+
======
321+
=====
187322

188323
==== Create databases with `IF NOT EXISTS` or `OR REPLACE`
189324

modules/ROOT/pages/database-administration/standard-databases/naming-databases.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Support for database names starting with a numeric character is available from N
2020
The `-` (dash) and `.` (dot) characters are not legal in Cypher variables.
2121
Names containing a `-` or that begin with a numeric character must be enclosed within backticks.
2222
For example, `CREATE DATABASE ++`main-db`++` is a valid database name.
23-
Database names are the only identifier for which dots do not need to be quoted.
24-
For example `main.db` is a valid database name.
25-
However, this behavior is deprecated due to the difficulty of determining if a dot is part of the database name or a delimiter for a database alias in a composite database.
23+
In Cypher 25, names that contain a dot (`.`) must be quoted in backticks.
24+
However, using dots in database names is not recommended, as it makes it difficult to determine if a dot is part of the database name or a delimiter for a database alias in a composite database.
25+
A future version of Neo4j may entirely disallow database names with dots.
2626
====
2727

2828
It is possible to create an alias to refer to an existing database to avoid these restrictions.

0 commit comments

Comments
 (0)