Let's assume that I have the following documents in mongodb in the employees collection:
db.employees.insert({_id: ObjectId("4d85c7039ab0fd70a117d733"), name: 'Siona',
manager: [ObjectId("4d85c7039ab0fd70a117d730"), ObjectId("4d85c7039ab0fd70a117d732")] })
Here, 'Siona' has two managers, indicated in the managers array. I know that Spring Data M3 has the concept of DBRefs, but the monogdb documentation indicates that DBrefs are expensive, and that we should just store ObjectId when possible.
My question is, is there any way to resolve the document that the objectID here is pointing to via the Spring Data Document api, or am I forced to perform a join on the client side, where:
Posted the same question in the Spring forums, and one of their community members responded:
We have to do the join ourself on the client side, if we don't use dbref.