Open Restage opened 9 years ago
This behavior is on purpose - the returned List directly delegates to an iterator provided by the datastore (i.e. Neo4j). This allows large results to be returned. If you need ordering you shoudl consider creating an active property with a cypher query e.g.:
@Label("MatchDay")
public interface MatchDay {
List<Event> getEvents();
@ResultOf
@Cypher("match (m:MatchDay)-[:HAS_EVENT]->(e:Event) where id(m)={this} return e order by e.date")
Result<Event> getOrderedEvents();
ListProxy Lists returned by fetching nodes via a node's relationship property are not sortable by calling Collection.sort(). That's because the set() method in the ListProxy is not yet implemented. Is this on purpose or just an incomplete implementation at this point in time? Personally I would prefer to sort the list in my application logic rather then querying the nodes in a specific order.
Small Example Code: