Last active
August 29, 2015 14:21
-
-
Save miharekar/2842e3f3ce2f74a3486a to your computer and use it in GitHub Desktop.
Most followed user
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Is there a better way to do this? I have User model | |
| Neo4j::Session.query | |
| .match('()-[n:FOLLOWS]->(u)') | |
| .with('u, COUNT(n) AS c') | |
| .return('u, c') | |
| .order('c DESC') | |
| .where('c > 2').to_a | |
| # Additionaly I want to remove some users %w(mrfoto mfilej otobrglez) for example | |
| # I came up with this but I'm wondering if there's a better way? | |
| .where("NOT (u.login in #{users})") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment