列出复合数据库

SHOW DATABASES 命令返回的 type 列显示哪些数据库是复合数据库。

查询
SHOW DATABASES
结果
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| name      | type        | aliases            | access       | address          | role      | writer | requestedStatus | currentStatus | statusMessage | default | home  | constituents       |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| "library" | "composite" | []                 | "read-only"  | "localhost:7687" | NULL      | FALSE  | "online"        | "online"      | ""            | FALSE   | FALSE | ["library.sci-fi"] |
| "neo4j"   | "standard"  | []                 | "read-write" | "localhost:7687" | "primary" | TRUE   | "online"        | "online"      | ""            | TRUE    | TRUE  | []                 |
| "sci-fi"  | "standard"  | ["library.sci-fi"] | "read-write" | "localhost:7687" | "primary" | TRUE   | "online"        | "online"      | ""            | FALSE   | FALSE | []                 |
| "system"  | "system"    | []                 | "read-write" | "localhost:7687" | "primary" | TRUE   | "online"        | "online"      | ""            | FALSE   | FALSE | []                 |
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

有关此命令返回的所有列的描述、SHOW DATABASE 命令的过滤方法以及命令所需权限的详细信息,请参阅 列出标准数据库

对于复合数据库,constituents 列特别有趣,因为它列出了构成复合数据库的别名。

查询
SHOW DATABASE library YIELD name, constituents
结果
+--------------------------------+
| name      | constituents       |
+--------------------------------+
| "library" | ["library.sci-fi"] |
+--------------------------------+