Open hansman opened 9 years ago
You're passing console.log
as a callback directly. Can you instead pass a proper function (err, node) { console.log(node); }
callback? Does that work?
The other thing is, you're not seeing if you're getting any errors. For each of the callbacks, it's good to check if (err) throw err;
where err
is the first param.
For sure. This code is only to point out the flow. console.log is sufficient to see that there is an empty response which is the point of this demonstration.
Got it. Would you mind confirming a couple things for sanity:
db.index
, but your code is actually node.index
, right?node.index
?Assuming both of these are indeed the case:
no errors. yes I use node.index. I can't get the node from the index even after a long delay. Not a eventual consistency case.
question: have you tried doing this yourself?
Okay, surprising.
No, I haven't tried this myself. We use exclusively v2 schema indexes and legacy auto-indexes, not legacy manual indexes. I can try myself later.
Another thing to try would be using the Neo4j webadmin to do these things manually. Does it work there? If so, suggests a node-neo4j or code bug. If not, suggests a Neo4j bug.
However, we do cover manual indexing in our tests, and that's always worked:
What happens here?
var indexName = 'myNodeIndex'; var node = db.createNode({name: 'hey'}); node.save(function() { db.index(indexName, 'name', 'hey', function() { db.getIndexedNode(indexName, 'name', 'hey', console.log) }) })
Expected: getIndexedNode returns the node that just got indexed.
Actual: getIndexedNode has empty response