Neo4j to SurrealDB mapping
Quickly learn how to map your Neo4j knowledge to corresponding SurrealDB concepts and syntax.
Introduction
As a multi-model database, SurrealDB offers a lot of flexibility. Our SQL-like query language SurrealQL is a good example of this, where we often have more than one way to achieve the same result, depending on developer preference. In this mapping guide, we will focus on the syntax that most closely resembles the Cypher query language.
Concepts mapping
For more in-depth explanations of SurrealDB concepts, see the concepts page.
Neo4j | SurrealDB |
---|---|
database | database |
node label | table |
node | record |
node property | field |
index | index |
id | record id |
transaction | transaction |
relationships | record links, embedding and graph relations |
Syntax mapping
Let's get you up to speed with SurrealQL syntax with some CRUD examples.
Create
As Neo4j is schemaless, only the SurrealQL schemaless approach is shown below. For a schemafull option see the define table page.
For more SurrealQL examples, see the create, insert and relate pages.
Cypher | SurrealQL |
---|---|
|
Table implicitly created if it doesn't exist |
|
There are many differences between how SurrealDB and Neo4j do graph relations. Check out the relate docs for more. |
|
|
Read
For more SurrealQL examples, see the select, live select and return pages.
Cypher | SurrealQL |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Update
For more SurrealQL examples, see the update page.
Cypher | SurrealQL |
---|---|
|
|
|
|
Delete
For more SurrealQL examples, see the delete and remove pages.
Cypher | SurrealQL |
---|---|
|
|
|
Node/Table still exists here but is empty |
|
Node/Table no longer exists |