nestjsx / nestjs-typeorm-paginate

:page_with_curl: Pagination response object function + types for typeorm + nestjs
MIT License
843 stars 122 forks source link

Asking : Find parameter #723

Closed ColeoptereMoroseDeVan closed 8 months ago

ColeoptereMoroseDeVan commented 2 years ago

Hi,

Requirements

Wanted

I want to filter my response data by a search param, like the example of the doc about cat and their lives. (I want to receive only cats that have 9 lives)

So, I tryed the example :

return paginate<CatEntity>(this.repository, options, {
      lives: 9,
    });

However, I don't get the expected value, I received all cats, no matter how much lives they have.

Researched

So I read the code and paginateRepository function add my value correctly, however the filters is not used.

After I checked the repository service I figured out that there is now two options handle by typeorm repository : find and findBy. Find accept { take, skip } FindBy accept { ...entityParams }

So my params can't be filter.

Question

Did I did something wrong, or is this a bug ? Should I use only queryBuilder to add my filters property ?


Thank's for your time and for this amazing module 👍

KhairoHumsi commented 2 years ago

Hi,

Requirements

  • "nestjs-typeorm-paginate": "^4.0.1"
  • "typeorm": "^0.3.6"

Wanted

I want to filter my response data by a search param, like the example of the doc about cat and their lives. (I want to receive only cats that have 9 lives)

So, I tryed the example :

return paginate<CatEntity>(this.repository, options, {
      lives: 9,
    });

However, I don't get the expected value, I received all cats, no matter how much lives they have.

Researched

So I read the code and paginateRepository function add my value correctly, however the filters is not used.

After I checked the repository service I figured out that there is now two options handle by typeorm repository : find and findBy. Find accept { take, skip } FindBy accept { ...entityParams }

So my params can't be filter.

Question

Did I did something wrong, or is this a bug ? Should I use only queryBuilder to add my filters property ?

Thank's for your time and for this amazing module 👍

Is there any update on this issue!!?

theothersideofgod commented 2 years ago

{where: {live: 9}}

SuperService commented 1 year ago

{ where: {email: Like(%${variable}%) } } not working with Like?