Is it possible (and if so how) to merge tags with the same value so that one tag has an array of all its galleries?
For example, begin with this:
[{
tag: "Kings",
galleries: [
"2016 Kings Draft Night"
]
}, {
tag: "Draft",
galleries: [
"2016 Kings Draft Night"
]
}, {
tag: "Kings",
galleries: [
"2016-17 Sacramento Kings Uniforms"
]
}]
and end with this:
[{
tag: "Kings",
galleries: [
"2016 Kings Draft Night", "2016-17 Sacramento Kings Uniforms"
]
}, {
tag: "Draft",
galleries: [
"2016 Kings Draft Night"
]
}]
Any help is much appreciated. Stumped on this