Closed BenjaminHolland10 closed 9 years ago
As you can see the user input variable is different.
@BenjaminHolland10 Hi, do you ever tried to query like this:
MATCH (b:User {id: {id}, registered: {registered}}) RETURN b
Could you please try the query I'm suggested above, and let me know about results.
Yeah that was my first attempt at it. I just tried it again just to make sure and the problem persisted.
This is the function that calls it just for reference. Don't think it has an effect.
Just to confirm, please do:
console.log(error, data);
server
and client
, with same log
as aboveserver
try to run query inside: Meteor.N4JDB.query(...);
First two are registered last one is not.
@BenjaminHolland10 inside of Meteor.N4JDB.query(...);
run console.log(error, data);
without b
property.
And what about client
side? Same result?
Client code: (N4JDB was giving me a undefined method error)
Server code:
N4JDB will work in my case just thought i'd let you know and document it for any other user facing the problem.
What would be the best way to access the data returned by the N4JDB query? @dr-dimitru
Same as in Meteor.neo4j.query()
, last argument is callback with error
and data
. In data
you should have raw data from Neo4j.
I'm sorry I'm pretty new to Javascript but when I try return the data from the callback it the return value is undefined. This probably has something to do with scope but I'm not sure. Here's what I have right now.
@BenjaminHolland10 you're fine.
I'm sure there is no data[0]
, so just console.log(data);
, then construct your logic statement based on what returned from database in different cases.
It's not parsing the data I'm having trouble with It's actually getting the data out of the callback into the outer function. Thank you so much for responding.
Yes, Meteor.N4JDB
works directly with Neo4j DB and returns data as it is presented in Neo4j.
Then Meteor.neo4j
parce and presents data in Mongo-like way used basically in Meteor
Okay, I see the right answer, if you prefer to work with data on server side. I believe in your case better to work with Neo4j as collection and publish/subscribe way. See this example.
Thanks for the advice. I have to rewrite a lot of my app but working the publish/subscribe way it a lot cleaner and easier to write.
I'm writing a query that matches a node with two properties except when I call the query it returns the same result multiple times. I know I'm passing in different id's and it actually returns different results if I change the Match variable( the a in (a:User)) but I don't know why its not returning the correct results all the time. I've tested the query in the console and it works.Here's my function and the results.