You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example that reproduces the problem uploaded to Github
Full description of the issue provided (see below)
Steps to Reproduce
Create a Test MongoDB.
Create a Grails Domain called Order with static mapWith = "mongo", BSON ObjectId id, Long orderId, (any other fields you desire) List orderItems and relationship static hasMany = [orderItems: OrderItem]
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]
Create up a simple controller, view, service etc in Grails and hook it up.
Populate some data in your Mongo Collections such that order.orderItems -> orderItem.id
In a Service method call:
Order.aggregate( [
Aggregates.lookup("orderitem", "orderItems", "_id", "orderItems")
] )
and observe the output for orderItems: [] is empty.
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
The text was updated successfully, but these errors were encountered:
Task List
Steps to Reproduce
Create a Test MongoDB.
Create a Grails Domain called Order with static mapWith = "mongo", BSON ObjectId id, Long orderId, (any other fields you desire) List orderItems and relationship static hasMany = [orderItems: OrderItem]
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]
Create up a simple controller, view, service etc in Grails and hook it up.
Populate some data in your Mongo Collections such that order.orderItems -> orderItem.id
In a Service method call:
Order.aggregate( [
Aggregates.lookup("orderitem", "orderItems", "_id", "orderItems")
] )
and observe the output for orderItems: [] is empty.
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
The text was updated successfully, but these errors were encountered: