Getting array of ids from array of elements
I have an array of foods ["Pizza", "Pasta", "Pasta", "Pizza"].
I also have a table of foods with a name and id, it's in the image.
I want to get all the ids from the foods in the array. I want it so that I am able to get multiple of the same ids.
The expected result is an array of ids that look like this: [1,2,2,1]
How would I go about doing this in supabase ts/js?
I also have a table of foods with a name and id, it's in the image.
I want to get all the ids from the foods in the array. I want it so that I am able to get multiple of the same ids.
The expected result is an array of ids that look like this: [1,2,2,1]
How would I go about doing this in supabase ts/js?
