Skip to content

USE

USE <graph_space_name>

The USE statement specifies a graph space as the current working space for subsequent queries. To manage multiple graph spaces, use the USE statement. The USE statement requires some privilege.

The graph space remains the same unless another USE statement is executed.

nebula> USE space1;
-- Traverse in graph space1.
nebula> GO FROM 1 OVER edge1;
nebula> USE space2;
-- Traverse in graph space2. These vertices and edges have no relevance with space1.
nebula> GO FROM 2 OVER edge2;
-- Now you are back to space1. Hereafter, you can not read any data from space2.
nebula> USE space1;

Note

You can't use two spaces in one statement.

Different from SQL or Fabric Cypher, making a graph space as the working graph space prevents you from accessing other spaces. The only way to traverse in a new graph space is to switch by the USE statement.

Graph spaces are FULLY ISOLATED from each other. Unlike Fabric Cypher, you can only use one graph space at a time in Nebula Graph. But in Fabric Cypher, you can use two (graph) spaces in one statement.


Last update: April 22, 2021
Back to top