Example blocks

Example blocks should have a background colour in the docs theme

Example 1

A short example

Example 1. This is a short one

Lorem Ipsunm

Some text follows the example

Example 2. This is also short

Lorem Ipsunm

And some more text here

Example 2

A longer example

Example 3. A longer example

Let’s assume there exists a procedure called myProc.

This procedure gives the result A and B for a user with EXECUTE PROCEDURE privilege and A, B and C for a user with EXECUTE BOOSTED PROCEDURE privilege.

Now, let’s adapt the privileges in examples 1 to 4 to apply to this procedure and show what is returned. With the privileges from example 1, granted EXECUTE PROCEDURE * and denied EXECUTE BOOSTED PROCEDURE myProc, the myProc procedure returns the result A and B.

With the privileges from example 2, granted EXECUTE BOOSTED PROCEDURE * and denied EXECUTE PROCEDURE myProc, execution of the myProc procedure is not allowed.

With the privileges from example 3, granted EXECUTE BOOSTED PROCEDURE * and denied EXECUTE BOOSTED PROCEDURE myProc, execution of the myProc procedure is not allowed.

With the privileges from example 4, granted EXECUTE PROCEDURE myProc and EXECUTE BOOSTED PROCEDURE * and denied EXECUTE BOOSTED PROCEDURE myProc, the myProc procedure returns the result A and B.

For comparison, when only granted EXECUTE BOOSTED PROCEDURE myProc, the myProc procedure returns the result A, B and C, without needing to be granted the EXECUTE PROCEDURE myProc privilege.

A line of text after the longer example

Run Cypher administrative commands from Cypher Shell on a cluster

For the following examples consider a cluster environment formed by 5 members, 3 Core servers, and 2 Read Replicas:

Example 4. View the members of a cluster
neo4j@neo4j> CALL dbms.cluster.overview();
+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| id        | addresses                                                                    | databases                   | groups |
+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| "8c...3d" | ["bolt://localhost:7683", "http://localhost:7473", "https://localhost:7483"] | {neo4j: "FOLLOWER", system: "FOLLOWER"}         | []     |
| "8f...28" | ["bolt://localhost:7681", "http://localhost:7471", "https://localhost:7481"] | {neo4j: "LEADER", system: "LEADER"}                   | []     |
| "e0...4d" | ["bolt://localhost:7684", "http://localhost:7474", "https://localhost:7484"] | {neo4j: "READ_REPLICA", system: "READ_REPLICA"}     | []     |
| "1a...64" | ["bolt://localhost:7682", "http://localhost:7472", "https://localhost:7482"] | {neo4j: "FOLLOWER", system: "FOLLOWER"}         | []     |
| "59...87" | ["bolt://localhost:7685", "http://localhost:7475", "https://localhost:7485"] | {neo4j: "READ_REPLICA", system: "READ_REPLICA"}     | []     |
+------------------------------------------------------------------------------------------------------------------------------------------------------------+

5 rows available after 5 ms, consumed after another 0 ms

The leader is currently the instance exposing port 7681 for the bolt protocol, and 7471/7481 for the http/https protocol.

Administrators can connect and execute Cypher commands in the following ways:

Example 5. Using the bolt:// scheme to connect to the Leader:
$ bin/cypher-shell -a bolt://localhost:7681 -d system -u neo4j -p neo4j1
Connected to Neo4j 4.0.0 at bolt://localhost:7681 as user neo4j.
Type :help for a list of available commands or :exit to exit the shell.
Note that Cypher queries must end with a semicolon.
neo4j@system> SHOW DATABASES;
+-------------------------------+
| name     | status   | default |
+-------------------------------+
| "neo4j"  | "online" | TRUE    |
| "system" | "online" | FALSE   |
+-------------------------------+

2 rows available after 34 ms, consumed after another 0 ms
neo4j@system> CREATE DATABASE data001;
0 rows available after 378 ms, consumed after another 12 ms
Added 1 nodes, Set 4 properties, Added 1 labels
neo4j@system> SHOW DATABASES;
+--------------------------------+
| name      | status   | default |
+--------------------------------+
| "neo4j"   | "online" | TRUE    |
| "system"  | "online" | FALSE   |
| "data001" | "online" | FALSE   |
+--------------------------------+

3 rows available after 2 ms, consumed after another 1 ms

Example block inside a list

  1. List item

    Example 6. An Example

    Lorem ipsum

  2. List item

  3. List item

  4. List item

    Example 7. An Example

    Lorem ipsum

  5. List item