Can I create a node in neo4j with the given id?

I want to maintain relationships in neo4j, but (maybe I havenโ€™t decided yet) to save objects in different databases (like Redis). And if you do this, it would be nice to synchronize the identifiers in the db repository and in neo4j. So, can I create a node in neo4j by passing it an ID?

PS project in PHP and access to neo4j through the REST API.

+8
php neo4j
source share
2 answers

Usually you cannot, only if you use BatchImporter, http://docs.neo4j.org/chunked/snapshot/indexing-batchinsert.html , you can specify the identifiers to use.

+2
source share

Otherwise, it is reasonable to use an external identifier as the node and index properties of the nodes of these properties. This way you have bi-directional permissions for your external identifier.

Indexing can also be done using an auto-indexer , so this happens automatically when you create, update, and delete a node.

You can also look at Neo4jPHP as a library for accessing the Neo4j REST API.

+2
source share

All Articles