leroy-merlin-br / mongolid

Easy, powerful and ultrafast ODM for PHP and MongoDB
MIT License
109 stars 27 forks source link

Feat: Eager load using foreign keys #205

Open diegofelix opened 1 year ago

diegofelix commented 1 year ago

This will enable to eager load using a foreign keys other than _id.

The setup will be


...

public $with = [
    'price' => [
        'key' => '_id',
        'foreignKey' => 'product_id',
        'model' => Price::class,
    ],
...
];