Hi, I’m coming from a neo4j background and struggling with dql a bit. here’s a diagram of the data:
I simply want to return the user recommended Mnemonics and filter them based on the phonem attribute of the Code nodes.
I’ve tried going from the User node downwards like so:
{
myquery(func: eq(User.username,"example@gmail.com")) {
User.recommended {
Mnemonic.full_name // need to filter here by the mnemonics code
Mnemonic.hasCode {
Code.phonem @filter(eq(Code.phonem, "FILTER_CODE"))
}
}
}
}
but of course this is returning all mnemonics as the filter is being applied to just the codes returned below. how can i apply this filter at the Mnemonic level?
example cypher query would be:
MATCH (:User {user_id: $user_id})-[:RECOMMENDS]->(m:Mnemonic)-[:HAS_CODE]->(:Code {phonem: $phonem}) RETURN m