这适用于了解 REST 和 Neo4j 的人员。
在 Neo4j 中创建节点之前是否可以命名节点?
典型的 Restful 事情是,您创建一个 URI“XXX/db/data/node/mynode”,并且您希望使用此标识符创建一个节点(如果此时不存在)。
对于我目前为止一直在研究(和测试)的所有内容,答案是:“不,这是不可能的,neo4j 总是会自动为创建的节点提供 id,并尝试创建 URI 并使用 POST 来因为它的创建将导致 405"
提前致谢。
This is for people with knowledge on REST and Neo4j.
Is it possible to name a node before creating it in Neo4j ?
Typical Restful thing, you create a URI "XXX/db/data/node/mynode" and you want to create a node with this identifier if it is not existent in the moment.
For all that I have been researching (and testing) to the present moment, the answer is : "no it is not possible, neo4j will just always automatically give ids to the created nodes and the attempt to do create a URI and use POST to cause its creation will result in 405"
Thanks in advance.
发布评论
评论(1)
没错,你不能设置节点的 id。您可以做的就是添加其他类型的 id 作为属性,请参阅 创建具有属性的节点。只需确保它自动索引,然后您就可以查询该索引的精确匹配。
That's correct, you can't set the id of a node. What you can do is to add some other kind of id as a property, see create node with properties. Just make sure it's indexed automatically and then you can query that index for exact matches.