eventsourcing/es4j

Problem: Min/Max queries are global to the attribute

Open

#209 geöffnet am 27. Jan. 2017

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Java (27 Forks)batch import
enhancementhelp wanted

Repository-Metriken

Stars
 (406 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

At this moment, Min/Max queries are limited to finding the smallest or largest value of a particular attribute globally across an entity. Which means you can tell "what's the latest order" but not "what's the latest order for this person". IsLatestEntity/LatestAssociatedEntryQuery are currently being used to address this type of need, but they are very slow and cumbersome. Min/Max has been already optimized for PostgreSQL storage.

It would have been great if it was possible to fit this type query within Min/Max as an option:

// Find the last order for user with id=<id>
max(Order.TIMESTAMP, equal(Order.USER_ID, id))
// Find all last orders for all users
max(Order.TIMESTAMP, Order.USER_ID)

(Or something similar)

Contributor Guide