From ce692287213a62e90c37f2f98a457e5771a7911e Mon Sep 17 00:00:00 2001 From: Brian Adams <59975830+brianadams731@users.noreply.github.com> Date: Sat, 15 Jan 2022 06:44:13 -0800 Subject: [PATCH] docs: adding undocumented behavior to findOptions doc (#8499) --- docs/find-options.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/find-options.md b/docs/find-options.md index b138667a4f..044f093ca2 100644 --- a/docs/find-options.md +++ b/docs/find-options.md @@ -266,6 +266,18 @@ userRepository.find({ }); ``` +If `undefined` is passed as an argument, find will return all items in the table, and findOne will return the first item in the table. +```ts +userRepository.find(undefined); + +``` + +will execute following query: + +```sql +SELECT * FROM "user" +``` + ## Advanced options TypeORM provides a lot of built-in operators that can be used to create more complex comparisons: