const door4 = ObjectId("someId");
const door3 = ObjectId("someId");
const Automatic = ObjectId("someId");
const filterPosts = await VFSPostViewSchema.aggregate([
{
$match: {
$and: [
{ "filterItem.id": { $in: [door4, Automatic] } },
{ "filterItem.id": { $nin: [door3] } },
],
},
},
]);
its my code i have condition in which i have two arrays includes and excludes
includes array = [“id1”,“id2”,“id3”] this will be the excat match i need that same data which match these all ids and dont return that if any one of that match i want to get those document which have all of this
exclude. array = [“id4”,“id5”,“id6”] i need to exclude all that document which has that ids