User.relsCheck(usernodes, function (err, rels) {
if (!err && rels) {
console.log('relationship ' + JSON.stringify(rels));
callback(null, new rels);
} else {
callback(err || new Error('friend request exists'));
}
});
User.relsCheck = function (nodes, callback) {
if (nodes.length !== 2) {
return callback(new Error('Invalid/insufficient arguments'));
}
var query = [
'START user=node({userId}), other=node({otherId})',
'MATCH (user) -[rels?:RELTYPE]-> (other)',
'RETURN rels'
].join('\n');
var params = {
userId: nodes[0].node().id,
otherId: nodes[1].node().id,
};
db.query(query, params, callback);
};
please help, thanks!
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.