Skip to content

postgrelize / exists

Function: exists() ​

exists(subquery): Exists

Defined in: src/expressions/methods.ts:166

postgrelize extension

EXISTS (subquery). PostgreSQL extension.

Parameters ​

subquery ​

Subquery

Subquery from Model.subquery().

Returns ​

Exists

Condition usable as where.

Example ​

ts
await User.findAll({ where: exists(Post.subquery({ where: { userId: col('User.id') } })) });

Released under the MIT License.