1

I use Neo4j.rb in Rails. I am trying this code.

 Person.all.order("n.score").find_each

or

Person.order(score: :asc).find_each

But,its does not get person order by.

1 Answers1

1

Currently the gem doesn't support that. You can see here that the order is fixed based on the property which is specified.

That link is from neo4j-core, by the way. You're using either this or this for ActiveNode. Those methods actually continue the hard-coding of the primary key as the ordering.

That said, this might not be necessary. When I was building the find_each / find_in_batches functionality I saw Cypher queries as potentially much more complicated than SQL queries because you don't just specify a column. I'm certainly open to other ideas

Brian Underwood
  • 10,746
  • 1
  • 22
  • 34
  • Cool ;) Again, if you have any thoughts on how to make things better for `ActiveNode` I'm all ears. Probably the best place for that is a new issue: https://github.com/neo4jrb/neo4j/issues/new – Brian Underwood Jul 07 '16 at 08:08