Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array text fields : QueryFailedError when using CondOperator.CONTAINS #793

Open
BenStirrup opened this issue Jun 22, 2022 · 0 comments
Open

Comments

@BenStirrup
Copy link

Bug Report

Current behavior

There is an error at the level of the ORM : QueryFailedError: operator does not exist: text[] ~~ unknown.

Input Code

// DB schema field
@Column('text', { array: true, default: [UserRole.EMPLOYEE] })
roles: UserRole[]

// Contraint type in filter / or
{ field: 'roles', operator: CondOperator.CONTAINS, value: UserRole.EMPLOYER }

Expected behavior

We should be able to filter on array fields.

Possible Solution

Modify the SQL generated when the field is an array.

Environment

  • nest crud : 5.0.0-alpha.3
  • typeorm: 0.2.45
  • Node version: 16.13.2
  • Database: Postgres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant