neode
neode copied to clipboard
How to get Node's relations
I'm struggling a little with this library. There is basically no documentation, and the examples in readme seems to be outdated.
If I get a node, using
instance.first("Node", "key", "value"),
how do I get all the relations it has?
I've described them in the model like so
contract: { type: 'relationship', relationship: 'CAN', direction: 'out', target: "Contract", eager: true },
but when I do node.get("contract"), it's supposed to return a Collection, which it doesn't,
it returns only the last created relation.
What am I missing?
Look at the #104 issue. It helped me to understand the concept and i was able to request and iterate on the resultset including relationships
type: 'relationship' will give you as single relationship, try relationships to get a collection of relationships. Sorry if this is unclear, I know it's confusing but I can't think of a better way of representing this