Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Using CYPHER: find the manager with maximum number of subordinates

I need to find a manager with the maximum number of subordinates (USING CYPHER). I need to know his/her id and how many subordinates are under his/her management control.    

I have created this query:

MATCH (b:UserNode) 
MATCH (b)-[r:IS_MANAGER_FOR]->(subordinate) 
RETURN b.user_id, 
       count(subordinate)
ORDER BY count(subordinate) DESC LIMIT 1

But something is wrong, could you help me with this, thank you in advance!

Comments