I have a large JSON file filled with data on over 300 different types of drinks, including their ingredients, names, and instructions. Each object in the file represents a unique drink recipe.
Here is an example of how one of these objects is structured:
"strCategory": "Beer",
"strDrink": "110 in the shade",
"strAlcoholic": "Alcoholic",
"dateModified":: "2016-02-03 14:51:57",
"strInstructionsIT": "Riempi un bicchierino di tequila.\r\nRiempi un boccale di birra con la birra chiara.\r\nMetti il bicchierino nella birra e bevi velocemente.",
"idDrink": "15423",
"strDrinkThumb": "https://www.thecocktaildb.com/images/media/drink/xxyywq1454511117.jpg",
"strCreativeCommonsConfirmed": "No",
"strGlass": "Beer Glass",
"Ingredients": [
{
"Ingredient": "Lager",
"Measurement": "16 oz "
},
{
"Measurement": "1.5 oz ",
"Ingredient": "Tequila"
}
],
"strInstructionsDE": "Shooter tröpfchenweise in ein Glas geben. Mit Bier füllen.",
"strInstructions": "Drop shooter in glass. Fill with beer"
},
{
...
}
One specific requirement I have is to filter the drink objects based on user-provided ingredients. The user may enter an array like this:
let Ingredients_Entered_By_User = ["Vodka", "Rum", "Lemonade"];
The goal is to find all drink recipes that contain all of the specified ingredients entered by the user. It doesn't have to be an exact match, but each drink must include all of those selected ingredients to be included in the filtered results.