Reputation: 2563
I'm new in Loopback so may be it sound silly. Here is my query
const treats = await treatDetails.find({
where: {
and: someArray,
endDate: { gt: someDate },
},
someArray
is an array on which i want to apply AND
operation and outside of that and i want to get records with endDate
greater than someDate
Upvotes: 1
Views: 46
Reputation: 3729
You can use and
with array of json object
.
Also you can add
endDate: { gt: someDate }
inand
let cond = [{ id: "id" }, { 'image': "url" }];
cons.push({ endDate: { gt: someDate } });
Model.find({ where: { and: cond } });
Upvotes: 3