Mongoose use $and to apply same attribute two filters
- use
$or
instead of$and
, because it would satisfy one of condition - remove
pending
status from$in
condition $and
to wrappackage
condition and$or
conditions
filter = { $and: [ { package: { $in: ids } }, { $or: [ { status: { $in: ["accepted", "charged", "captured"] } }, { status: "pending", date: { $lt: current_time } } ] } ]};