mhemani opened a new issue, #14393:
URL: https://github.com/apache/grails-core/issues/14393
### Task List
- [ ] Steps to reproduce provided
- [ ] Stacktrace (if present) provided
- [ ] Example that reproduces the problem uploaded to Github
- [ ] Full description of the issue provided (see below)
### Steps to Reproduce
1. Create a Test MongoDB.
2. Create a Grails Domain called Order with static mapWith = "mongo", BSON
ObjectId id, Long orderId, (any other fields you desire) List<OrderItem>
orderItems and relationship static hasMany = [orderItems: OrderItem]
3. Create another Grails Domain called OrderItem with static mapWith =
"mongo", , BSON ObjectId id, Long orderId, (any other fields that you desire)
and relationship static belongsTo = [Order]
4. Create up a simple controller, view, service etc in Grails and hook it up.
5. Populate some data in your Mongo Collections such that order.orderItems
-> orderItem.id
6. In a Service method call:
Order.aggregate( [
Aggregates.lookup("orderitem", "orderItems", "_id", "orderItems")
] )
and observe the output for orderItems: [] is empty.
7. In a Service method call:
Order.collection.aggregate( [
Aggregates.lookup("orderitem", "orderItems", "_id", "orderItems")
] ).toList()
and observe the output for orderItems: [ ... ] has proper data.
### Expected Behaviour
When doing aggregate lookups, the lookup should return the join data.
### Actual Behaviour
Join data is missing when aggregate lookup is performed using Grails Domain.
Using the underlying collection to do aggregate lookup, join data is available.
### Environment Information
- **Operating System**: Win10
- **GORM Version:** 7.0.0
- **Grails Version (if using Grails):** 4.0.0
- **JDK Version:** 1.8
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]