Filtering SHOW results
Goals
This guide shows how to better utilize results of the `SHOW` command.
Prerequisites
You should be familiar with managing databases. You should also be familiar with the commands to Docs: Manage Users.
Beginner
SHOW commands in Neo4j 4.0
In Neo4j 4.0, we introduced these commands to help you manage a Neo4j instance and users. Note that in 4.0, these commands had to be issued from the system database.
SHOW DATABASES SHOW DATABASE [DEFAULT DATABASE] | [<database-name>]
SHOW USERS SHOW USER <user-name>
SHOW [ALL | POPULATED] ROLES [WITH USERS} SHOW ROLE <role-name> PRIVILEGES
SHOW PRIVILEGES
Using SHOW commands in Neo4j 4.1
In 4.1, these commands have been enhanced so you can filter results to display. You can specify specific columns that you want to return or filter. In addition, you need not run these commands using the system database.
For example:
SHOW DATABASES YIELD name, currentStatus WHERE name CONTAINS 'test' AND currentStatus = 'online';
Here is another example:
SHOW ROLE reader PRIVILEGES YIELD access, resource, segment, action WHERE access = 'GRANTED' AND action = 'match';
Resources
Are you struggling?
If you need help with any of the information contained on this page, you can reach out to other members of our community.
You can ask questions in the Cypher category on the Neo4j Community Site.
|
Was this page helpful?