Reputation: 615
this.sampleRepo.find (
{
where: {
id: In ["1","7","13"]
}
order: {
id: "DESC"
},
select: ['id','group']
}
);
how to add where clause here so that i can find records only where user id is one or 7 or 13.
Upvotes: 3
Views: 5003
Reputation: 3356
You've missed round brackets and probably missed importing the In
operator:
import { In } from 'typeorm';
...
...
...
this.sampleRepo.find({
where: {
id: In(['1', '7', '13'])
},
order: {
id: 'DESC'
},
select: ['id', 'group']
});
Upvotes: 6