Hello,
I have some documents represented like this:
class ScanModel(Document):
uuid = UUIDField(default=uuid1, required=True)
user = LazyReferenceField(UserModel)
restaurant = LazyReferenceField(RestaurantModel)
The restaurant document are in the database as the scan, but the user are in another database. I can query the database to get the restaurant object using aggregation, but I need to fetch() the user object for every document returned because MongoDB doesn't support cross-database $lookup.
Is there a better way to do this? and maybe not have to face the N+1 problem?