From b0ce05f13c652093fb31fc5dc75e19b753720916 Mon Sep 17 00:00:00 2001 From: Jessica Wright <49636617+AlexicaWright@users.noreply.github.com> Date: Mon, 4 Dec 2023 14:25:02 +0100 Subject: [PATCH] add query for counting databases in a cluster (#1224) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jens Pryce-Ã…klundh <112686610+JPryce-Aklundh@users.noreply.github.com> --- .../standard-databases/manage-databases.adoc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/ROOT/pages/database-administration/standard-databases/manage-databases.adoc b/modules/ROOT/pages/database-administration/standard-databases/manage-databases.adoc index 8d5b83fee..0c89e6b76 100644 --- a/modules/ROOT/pages/database-administration/standard-databases/manage-databases.adoc +++ b/modules/ROOT/pages/database-administration/standard-databases/manage-databases.adoc @@ -300,13 +300,13 @@ SHOW DATABASE movies YIELD * === Show the number of databases -The number of databases can be seen using a `count()` aggregation with `YIELD` and `RETURN`. +The number of distinct databases can be seen using `YIELD` and a `count()` function in the `RETURN` clause. .Query [source, cypher] ---- -SHOW DATABASES YIELD * -RETURN count(*) AS count +SHOW DATABASES YIELD name +RETURN count(DISTINCT name) AS count ---- .Result @@ -319,6 +319,9 @@ RETURN count(*) AS count +-------+ ---- +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. + + === Show the default database The default database can be seen using the command `SHOW DEFAULT DATABASE`.