Update eager-and-lazy-relations.md (#10757)

Tweaking copy in eager and lazy relations doc for better readability.

Co-authored-by: Michael Bromley <michaelbromley@users.noreply.github.com>
This commit is contained in:
Joel Myers 2025-02-27 20:53:49 -05:00 committed by GitHub
parent 988673c549
commit d52ecf60a7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,7 +141,7 @@ const categories = await question.categories
// you'll have all question's categories inside "categories" variable now
```
Note: if you came from other languages (Java, PHP, etc.) and are used to use lazy relations everywhere - be careful.
Those languages aren't asynchronous and lazy loading is achieved in a different way, that's why you don't work with promises there.
In JavaScript and Node.JS you have to use promises if you want to have lazy-loaded relations.
This is non-standard technique and considered experimental in TypeORM.
Note: if you come from other languages (Java, PHP, etc.) and are used to using lazy relations everywhere - be careful.
Those languages aren't asynchronous, and lazy loading is achieved in a different way, without the use of promises.
In JavaScript and Node.JS, you have to use promises if you want to have lazy-loaded relations.
This is a non-standard technique and considered experimental in TypeORM.