I think the cause of the problem is the method
MongoDBDialect#doAggregate
. It needs to unwind (http://docs.mongodb.org/manual/reference/operator/aggregation/unwind/) the result of a query when an embedded collection appears in the projection list.
I don't think it's something we can solve. Maybe we can try sending a test to the FongoDB project. Excluding the test for FongoDB and add note in the doucumentation seems a viable option to me.
Also, keep in mind this note from Emmanuel Bernard (on IRC the link is attached to the JIRA):
about fongo, it's likely that the MongoDB 3 driver migration will break it probably enough that we will ahve to remove the support
|