We are using the Quarkus MongoDB Panache extension as an ORM for our application. We have two collections: Profile and User. When I query the profile using the user id, I get the results, but I am unable to map it to the Entity class.
Document query = new Document("user.$id", new ObjectId(userId));
I followed the official guide mentioned here and checked the SOF post here. Even when I tried with the Mongo Client, I encountered the same problem.
Can someone please share the sample code to map DBRef field to Java Pojo?
Profile collection
{
"profile_name": "Ragav"
"user" : { "$ref" : "user", "$id" : "001" },
"created_by" : "system",
"created_date" : "2024-04-12T05:43:26.521+0000",
}
User collection
{
"id": "001",
"login":"ragav",
"password":"jdhfsahgfhghfg"
}