brikteknologier / seraph

A thin and familiar layer between node and neo4j's REST api.
MIT License
309 stars 59 forks source link

find with label returns nodes that don't have that label #189

Closed databu closed 8 years ago

databu commented 9 years ago

Executing this on my db (where variable s is my seraph instance):

s.find({sqlId: 215}, true, 'client', function(error, nodes) {
  _.map(nodes, function(node) {s.readLabels(node, console.log)});
});

outputs this:

[ 'client', 'person' ]
[ 'person', 'driver' ]

If I understand the documentation for find correctly, the "any" parameter should only affect the predicate object, but not the label constraint, so only the first node with labels [ 'client', 'person' ] should be returned in my example.

jonpacker commented 9 years ago

You're right, that is definitely some super strange behaviour. I don't really know why that would happen. Could you possibly insert a console.log(cypher) at line 313 in node_modules/seraph/lib/node.js, run the find again, and copy and paste the outputted cypher query in here?

jonpacker commented 8 years ago

Can't replicate. Will open again if more information is provided.

databu commented 8 years ago

This was actually because of a neo4j bug corrupting the cache during an upgrade, see https://github.com/neo4j/neo4j/issues/5991

After I deleted the schema and index folders as described there, seraph.readLabels also worked again as expected.

Sorry I forgot to close this issue.