Using order_by with Relationship Properties
See original GitHub issueI see in the documentation that I can use obj.rel.order_by('prop_name')
to order the relatives by the given node property. But what if I want to order by a relation property? Something like this:
class OrderedRel(StructuredRel):
order = IntegerProperty(required=True)
class Item(StructuredNode):
...
class NodeSequence(StructuredNode):
item = RelationTo('Item', 'ITEM', model=OrderedRel)
for item in node_sequence.item.order_rel_by('order'):
...
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:7
Top Results From Across the Web
Order by relationship properties neo4j - Stack Overflow
I'm fine using ORDER BY with node properties, but have not been successful with relationships (story of my life...) neo4j · sql-order-by ·...
Read more >Order by on relationship field - Laracasts
This is why we can't order by a relation field. SELECT * FROM users; SELECT * FROM roles WHERE id IN (1, 2,...
Read more >ORDER BY - Cypher Manual - Neo4j
You can order by multiple properties by stating each variable in the ORDER BY clause. Cypher will sort the result by the first...
Read more >Ordering database queries by relationship columns in Laravel
In this article we're going to explore how to order database queries by the value (column) of an Eloquent relationship.
Read more >Laravel Eloquent: Order By Relationship - Two Ways - YouTube
Quite a regular task, but not a simple solution: how to order query results by a belongsTo relation column? I will show you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Then? Any solution?
Any update on this? I was hoping to encode an “active” attribute in a relationship and use that to filter my queries. I will try the suggestions above.