jadell / neo4jphp

PHP wrapper of the Neo4j REST interface
Other
532 stars 137 forks source link

getNodesForLabel not working with propertyName ,value parameters #151

Open sarathsprakash opened 10 years ago

sarathsprakash commented 10 years ago

I have used the below code to get all the node with label 'user ' and property 'id', and value '12345',but it returns null, But when I used only label without property, it worked fine.

<?php

require("vendor/autoload.php");

use Everyman\Neo4j\Client, Everyman\Neo4j\Index\NodeIndex, Everyman\Neo4j\Relationship, Everyman\Neo4j\Node, Everyman\Neo4j\Cypher, Everyman\Neo4j\Traversal;

$client = new Everyman\Neo4j\Client(); $label = new Everyman\Neo4j\Label($client, 'user'); $startNodes = $client->getNodesForLabel($label,'id','12345'); $startNodes->count();

?>

jgillmanjr commented 10 years ago

It seems like 'id' would be a unique property, so I'm not sure why multiple nodes would have it..

Still, have you tried dropping the single quotes so it's just treated as an integer?

ikwattro commented 10 years ago

Tested on my local env, I can't reproduce this issue, working with id property and the value in quotes.