Skip to content

Commit 982c1ba

Browse files
add query for counting databases in a cluster (#1224) (#1233)
Co-authored-by: Jens Pryce-Åklundh <[email protected]>
1 parent d14686e commit 982c1ba

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,13 @@ SHOW DATABASE movies YIELD *
300300

301301
=== Show the number of databases
302302

303-
The number of databases can be seen using a `count()` aggregation with `YIELD` and `RETURN`.
303+
The number of distinct databases can be seen using `YIELD` and a `count()` function in the `RETURN` clause.
304304

305305
.Query
306306
[source, cypher]
307307
----
308-
SHOW DATABASES YIELD *
309-
RETURN count(*) AS count
308+
SHOW DATABASES YIELD name
309+
RETURN count(DISTINCT name) AS count
310310
----
311311

312312
.Result
@@ -319,6 +319,9 @@ RETURN count(*) AS count
319319
+-------+
320320
----
321321

322+
By specifying the `name` column and sorting the results by distinct name, only the number of distinct databases are counted, **not** the number of allocations of databases in a clustered environment.
323+
324+
322325
=== Show the default database
323326

324327
The default database can be seen using the command `SHOW DEFAULT DATABASE`.

0 commit comments

Comments
 (0)