J
J
jedifa2021-08-27 15:35:13
ORM
jedifa, 2021-08-27 15:35:13

How to properly filter a typeorm request?

Tell me please, I'm looking in the database table for everything except where status is not 1 and not 4

const orders = await this.orderRepository.find({
      status: Not(1),
    });

here I am looking for everything where status is not 1, but I need to search for everything that is not 1 and not 4 how to do this?
did like this
const orders = await this.orderRepository.find({
      status: Not(1,4),
    });

but it gives an error, how to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shvedov, 2021-08-27
@jedifa

try
status: Not(In(1, 4)),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question