My MySQL and Typeorm skills are at a beginner level. When I run my query, it returns data with duplicate IDs like:
[
{
id: "1",
name: "john",
place: "San Francisco"
},
{
id: "1",
name: "john",
place: "Mumbai"
}
]
What I'm looking for is to retrieve unique entries based on ID, such as:
[
{
id: "1",
name: "john",
place: ["San Francisco", "Mumbai"]
}
]
I need help understanding how to use groupBy to achieve this desired result. Can anyone assist me?