简体   繁体   English

neo4jphp:是否可以通过属性检索节点?

[英]neo4jphp: Is it possible to retrieve a node by a property?

I'm using neo4jphp to work with a neo4j database using PHP. 我正在使用neo4jphp使用PHP处理neo4j数据库。 It has this method for selecting a node from the database: 它具有用于从数据库中选择节点的这种方法:

$select = $neo->getNode(4); // 4 is the node's id

However, I will not always know the id for the node I want. 但是,我并不总是知道我想要的节点的ID So is it possible to select a node by its property instead? 那么是否可以通过其属性选择节点呢?

For example: 例如:

$select = $neo->getNode('name', 'Greg');


https://github.com/jadell/neo4jphp/wiki/Nodes-and-Relationships https://github.com/jadell/neo4jphp/wiki/Nodes-and-Relationships

You can do this using indexes, labels, or using Cypher queries. 您可以使用索引,标签或使用Cypher查询来执行此操作。 There is no built-in way in neo4jphp to query for nodes by property. neo4jphp中没有内置方法可以按属性查询节点。

Also, neo4jphp is built for an earlier version of Neo4j. 另外,neo4jphp是为Neo4j的早期版本构建的。 If you are using a more recent version of Neo4j, I would recommend using a more up-to-date library for connecting Neo4j to a PHP application: https://github.com/graphaware/neo4j-php-client 如果您使用的是Neo4j的较新版本,我建议您使用更新的库将Neo4j连接到PHP应用程序: https : //github.com/graphaware/neo4j-php-client

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM