Skip to content

Commit efb71fc

Browse files
committed
Separate parameter examples for CREATE and ALTER
1 parent 4cc8fb0 commit efb71fc

File tree

1 file changed

+34
-18
lines changed

1 file changed

+34
-18
lines changed

modules/ROOT/pages/clustering/databases.adoc

Lines changed: 34 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ To create a database `foo` with 3 servers hosting the database in primary mode a
1919
----
2020
CREATE DATABASE foo TOPOLOGY 3 PRIMARIES 2 SECONDARIES
2121
----
22+
Alternatively, using link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/syntax/parameters[parameters]:
23+
24+
.Parameters
25+
[source,javascript, indent=0]
26+
----
27+
{
28+
"dbname": "foo",
29+
"primary": 3,
30+
"secondary": 2
31+
}
32+
----
33+
34+
.Query
35+
[source, cypher, indent=0]
36+
----
37+
CREATE DATABASE $dbname TOPOLOGY $primary PRIMARIES $secondary SECONDARIES
38+
----
2239

2340
The command can only be executed successfully if the cluster's servers are able to satisfy the specified topology.
2441
If they are not, the command results in an error.
@@ -36,24 +53,6 @@ However, over time, or after several `CREATE DATABASE` commands have been issued
3653
At this point you can run `REALLOCATE DATABASES` to make the cluster re-balance databases across all servers that are part of the cluster.
3754
====
3855

39-
The `CREATE DATABASE` and `ALTER DATABASE` commands support the usage of link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/syntax/parameters[parameters] when providing the database, the number of primaries and/or the number of secondaries.
40-
41-
.Parameters
42-
[source,javascript, indent=0]
43-
----
44-
{
45-
"dbname": "foo",
46-
"primary": 1,
47-
"secondary": 2
48-
}
49-
----
50-
51-
.Query
52-
[source, cypher, indent=0]
53-
----
54-
CREATE DATABASE $dbname TOPOLOGY $primary PRIMARIES $secondary SECONDARIES
55-
----
56-
5756
[[alter-database]]
5857
== `ALTER DATABASE`
5958

@@ -68,6 +67,23 @@ To change the topology of the database `foo` from the previous example, the comm
6867
----
6968
ALTER DATABASE foo SET TOPOLOGY 2 PRIMARIES 1 SECONDARY
7069
----
70+
Alternatively, using link:{neo4j-docs-base-uri}/cypher-manual/{page-version}/syntax/parameters[parameters]:
71+
72+
.Parameters
73+
[source,javascript, indent=0]
74+
----
75+
{
76+
"dbname": "foo",
77+
"primary": 2,
78+
"secondary": 1
79+
}
80+
----
81+
82+
.Query
83+
[source, cypher, indent=0]
84+
----
85+
ALTER DATABASE $dbname SET TOPOLOGY $primary PRIMARIES $secondary SECONDARIES
86+
----
7187

7288
Like the `CREATE DATABASE` command, this command results in an error if the cluster does not contain sufficient servers to satisfy the requested topology.
7389

0 commit comments

Comments
 (0)