Memgraph supports the openCypher query language which has been developed by Neo4j. It is a declarative language developed specifically for interaction with graph databases, which is currently going through a vendor-independent standardization process.
The easiest way to execute openCypher queries against Memgraph is by using
Memgraph's command-line tool,
mg_client, which is installed
together with Memgraph.
mg_client is a deprecated tool still coming within the Memgraph package.
mgconsole will replace
the future. If possible, please use
If you installed Memgraph using Docker, you will need to run the client
using the following command (remember to replace
HOST with valid IP of
the container - see Docker Note):
Otherwise, you can connect to the running Memgraph instance by issuing the following shell command:
After the client has started it should present a command prompt similar to:
At this point, it is possible to execute openCypher queries on Memgraph. Each
query needs to end with the
; (semicolon) character. For example:
The above will create 2 nodes in the database, one labeled "User" with name "Alice" and the other labeled "Software" with name "Memgraph". It will also create a relationship that "Alice" likes "Memgraph".
To find created nodes and relationships, execute the following query:
Telemetry is an automated process by which data is collected at a remote point. At Memgraph, we use telemetry for the sole purpose of improving our product, thereby collecting data about the machine that executes the database (CPU, memory, OS, and kernel information) as well as data about the database runtime (CPU usage, memory usage, vertices, and edges count).
Here at Memgraph, we care deeply about the privacy of our users and do not
collect any sensitive information. If you wish to disable Memgraph's telemetry
features, you can do so easily, either by altering the line in
/etc/memgraph/memgraph.conf that enables telemetry (set
--telemetry-enabled=true to the following
--telemetry-enabled=false), or by
--telemetry-enabled=false as a command-line argument when running
To learn more about the Cypher language, visit the Cypher manual or Memgraph Playground for interactive guides. For real-world examples of how to use Memgraph, we strongly suggest going through one of the available Tutorials. Details on what can be stored in Memgraph can be found in the article about Data storage.
Visit the Getting help page in case you run into any kind of problem or you have additional questions.