我可以在neo4j中创建一个具有指定ID的节点吗? [英] Can I create a node in neo4j with specified id?

查看:1368
本文介绍了我可以在neo4j中创建一个具有指定ID的节点吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在neo4j中保持关系,但是(也许,我还没有决定)将对象保留在不同的DB(某种Redis)中. 如果这样做的话,最好在存储数据库和neo4j中同步ID. 那么,我可以在neo4j中创建一个将ID传递给它的节点吗?

I want to hold relationships in neo4j but (maybe, I've not decided yet) to keep the objects in different DB (sort of Redis). And if to do so, it would be good to sync IDs in storage db and in neo4j. So, can I create a node in neo4j passing the ID to it?

PS PHP中的项目,并通过REST API访问neo4j.

PS project in PHP and accessing neo4j via REST API.

推荐答案

否则,将外部ID用作节点属性和

Otherwise it is sensible to use external id's as node properties and index the nodes on those properties. So you have bi-directional resolutions of your external id's.

也可以使用自动索引器,因此它会在创建,更新和删除节点时自动发生.

The indexing can also be done using the auto-indexer, so it happens automatically on node creation, update and removal.

您还可以将 Neo4jPHP 用作访问Neo4j REST API的库.

You might also look into Neo4jPHP as a library to access Neo4j's REST API.

这篇关于我可以在neo4j中创建一个具有指定ID的节点吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆