var individuals = [
{ Skin: "Bronze", Place: ["South"] },
{ Skin: "Copper", Place: ["North", "South"] },
{ Skin: "Copper", Place: ["North"] }
];
var requirements = [
{ Field: "Skin", Values: ["Copper"] },
{ Field: "Place", Values: ["North", "South"] }
];
In this scenario, the skin field is a string type, and the place field is an array. There are various individuals listed, along with specified filter criteria. The goal is to display only those records where all selected values in the filter match with the data. This includes checking for an exact match based on all criteria provided (without any OR conditions).
Hence, the desired output will be:
{ Skin: "Copper", Place: ["North", "South"] }
If the filter criteria changes to:
var requirements = [
{ Field: "Skin", Values: ["Copper"] },
{ Field: "Place", Values: ["North"] }
];
The output would then include:
{ Skin: "Copper", Place: ["North", "South"] },
{ Skin: "Copper", Place: ["North"] }
It's essential that all specified filter values align with the records completely.