From 14d6b2c23fac48a9ef90777cef1a04fd7663d6d9 Mon Sep 17 00:00:00 2001 From: Alexander Sandor <137198655+SandPod@users.noreply.github.com> Date: Wed, 27 Mar 2024 10:47:18 +0100 Subject: [PATCH] fix: document empty set behavior. (#84) --- docs/05-concepts/06-database/06-filter.md | 5 +++-- .../version-1.2.0/05-concepts/06-database/06-filter.md | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/05-concepts/06-database/06-filter.md b/docs/05-concepts/06-database/06-filter.md index 7a82d461..fdeb6ec9 100644 --- a/docs/05-concepts/06-database/06-filter.md +++ b/docs/05-concepts/06-database/06-filter.md @@ -98,7 +98,7 @@ await User.db.find( ); ``` -In the example we fetch all users with a name matching either Alice or Bob. +In the example we fetch all users with a name matching either Alice or Bob. If an empty set is used as an argument for the inSet comparison, no rows will be included in the result. The 'not in set' operation functions similarly to `inSet`, but it negates the condition. @@ -107,7 +107,8 @@ await User.db.find( where: (t) => t.name.notInSet({'Alice', 'Bob'}) ); ``` -In the example we fetch all users with a name not matching Alice or Bob. Rows with a `null` value in the column will be included in the result. +In the example we fetch all users with a name not matching Alice or Bob. Rows with a `null` value in the column will be included in the result. If an empty set is used as an argument for the notInSet comparison, all rows will be included in the result. + ### Like diff --git a/versioned_docs/version-1.2.0/05-concepts/06-database/06-filter.md b/versioned_docs/version-1.2.0/05-concepts/06-database/06-filter.md index 7a82d461..ec85e5b1 100644 --- a/versioned_docs/version-1.2.0/05-concepts/06-database/06-filter.md +++ b/versioned_docs/version-1.2.0/05-concepts/06-database/06-filter.md @@ -98,7 +98,7 @@ await User.db.find( ); ``` -In the example we fetch all users with a name matching either Alice or Bob. +In the example we fetch all users with a name matching either Alice or Bob. If an empty set is used as an argument for the inSet comparison, no rows will be included in the result. The 'not in set' operation functions similarly to `inSet`, but it negates the condition. @@ -107,7 +107,7 @@ await User.db.find( where: (t) => t.name.notInSet({'Alice', 'Bob'}) ); ``` -In the example we fetch all users with a name not matching Alice or Bob. Rows with a `null` value in the column will be included in the result. +In the example we fetch all users with a name not matching Alice or Bob. Rows with a `null` value in the column will be included in the result. If an empty set is used as an argument for the notInSet comparison, all rows will be included in the result. ### Like