I am using nest js framework
for my demo application. In my demo application I have an entity Category
which has two columns (id, description
). description
is jsonb
type.
export class Category extends BaseEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({ type: 'jsonb' })
description;
}
I inserted some data in my table.
Now I want to filter that data and only show those rows which have
name = test
.
Currently I'm using the code shown here, which returns all rows. But I need only the rows which have name equals to test
. Currently there is only one row
@Get('/app')
async getApp(): Promise<Category[]> {
return this.categoryRepository.find({});
}
Here is my full code: https://codesandbox.io/s/nest-nhqyb?file=/src/app.controller.ts:568-670
You can see filter result like