-
Notifications
You must be signed in to change notification settings - Fork 241
Open
Labels
documentationIssues requiring modifications to the documentationIssues requiring modifications to the documentation
Description
Expected Behavior (Mandatory)
Based on the Traversals and ordering chapter we expect to be able to order based on a relationship property
Actual Behavior (Mandatory)
from neomodel import StructuredNode, StructuredRel, DateTimeProperty, StringProperty, IntegerProperty, RelationshipFrom
from datetime import datetime
class SupplierRel(StructuredRel):
since = DateTimeProperty(default=datetime.now)
class Supplier(StructuredNode):
name = StringProperty()
delivery_cost = IntegerProperty()
class Coffee(StructuredNode):
name = StringProperty(unique_index=True)
price = IntegerProperty()
suppliers = RelationshipFrom(Supplier, 'SUPPLIES', model=SupplierRel)
r = Coffee.nodes.order_by(
'-suppliers__delivery_cost',
'suppliers|since',
)
r.all()
# no sorting
query: MATCH (coffee:Coffee) RETURN coffee
params: {}
took: 0.053s
Currently used versions
Versions
- OS: Linux
- Library: 5.5.0
- Neo4j: 5.25.0
Metadata
Metadata
Assignees
Labels
documentationIssues requiring modifications to the documentationIssues requiring modifications to the documentation