Search code examples
javascripttypescriptpostgresqlnestjstypeorm

TypeORM AND Find Option


I have products with a price, I want to find products whose price will be less than 10 but more than 5. So that SQL query looks like this:

SELECT * FROM products WHERE products.price < 10 AND products.price > 5

Is it possible to do this without using Query Builder?

I don't find the And operator in the documentation


Solution

  • The better way is to use Between Operator in your case. Between(1, 10) 1<x<10