Working with RedisGraph: your brain and old habits are your worst enemy

#fetch edges
WITH $ids as ids MATCH (e:entity)-[r]->(t:entity) where e.id in ids RETURN DISTINCT e.id,t.id,max(r.rank) ORDER BY r.rank
#fetch nodes
WITH $ids as ids MATCH (e:entity) where e.id in ids RETURN DISTINCT e.id,e.name,max(e.rank)
WITH $ids as ids MATCH (e:entity)-[r]->(t:entity) where (e.id in ids) and (r.year in $years) RETURN DISTINCT e.id, e.name,e.rank, t.id, t.name, t.rank, max(r.rank), r.year ORDER BY r.rank DESC
#flatten dict
node_list=[{'name':k,'id':node_dict[k]['id'],'rank':node_dict[k]['rank']} for k in node_dict]

--

--

--

I am a systems thinker with a deep understanding of technology and a methodological approach to innovation

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

CMake -Beginners: How to build a project using CMake

Our first Collabrative project at Masai school “Mamaearth clone”

All you Need to Know about Moodle LMS

DMEX’s CEO Nurtan Turan: Explore more DeFi functions and construct a prosperous and efficient…

Deploy a Create-React-App to Github

Pair Programming For The Win

Painless Spring boot tutorial with Maven Kotlin & MongoDB

Data Capture Layer @ MakeMyTrip

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alex Mikhalev

Alex Mikhalev

I am a systems thinker with a deep understanding of technology and a methodological approach to innovation

More from Medium

Redis Pipeline

Improve API Response Time With Cache

Why We Should Consider Order Of Column In Postgres While Capacity Planning

Revise GIT, CAP theorem and MongoDB