-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query
-
None
-
5
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Support the HQL EXISTS subquery pattern that filters on elements of an embedded array, translating it to MongoDB's $elemMatch operator.
Example HQL:
SELECT c FROM Cart c
WHERE EXISTS (SELECT 1 FROM LATERAL UNNEST(c.lineItems) li WHERE li.sku = 'WIDGET-1' AND li.qty > 2)
Expected MQL:
{ "$match": { "lineItems": { "$elemMatch": { "sku": "WIDGET-1", "qty": { "$gt": 2 } } } } }
This shape preserves parent cardinality — one result row per matching Cart regardless of how many lineItems match — and maps naturally to $elemMatch without requiring $unwind.
- is related to
-
HIBERNATE-93 Support path expressions for struct aggregate embeddables
-
- Backlog
-
-
HIBERNATE-58 Support arrays/collections mapping
-
- Closed
-