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

Programming The Mind

How to start a blog for free

Managing Kubernetes Job with Helm

Screen recording & annotating using ZOOM

Screen recording & annotating using ZOOM

What is computer program and programming?

How To Create An Advanced Website Crawler With JMeter

How to send notifications to suppliers when their products hit a low stock quantity

How to Work with FILTER, KEEPFILTERS, REMOVEFILTERS Functions in DAX — DAX in Power BI — Chapter 17

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

Thoughts on testing in a distributed system

Microservices: Why So Serious?

Redis Incredible Traits

Scalable read and write operations in backend systems