neode
neode copied to clipboard
Using filter on relationships
Hello there, I need some help to do something, if anyone can help me if this has already been done.
{
friends: {
type: "relationships",
target: "Person",
relationship: "FRIENDS",
direction: "out",
properties: {
intimacy: {
type: 'string',
valid: ['close', 'regular']
}
},
eager: true // can be false
}
}
I want do do something like
const people = person.all({ 'friends.intimacy': 'close' })
or
const people = person.all()
const friends = people.get('friends', { intimacy: 'close' })
Is it possible?
This isn't possible at the moment. From a Neo4j point of view I'd recommend against this because it won't perform very well. Essentially you'd be going through every Person node, then expanding every FRIENDS relationship and filtering on a property - this would be expensive.
Can I ask the use case?