I have the following json output for products:
{
"userProducts": [
{
"velas": "yes",
"bobina": "yes",
"aquecedoras": "no",
"sensores": "yes",
"terminais": "no",
"cabos": "yes",
"especiais": "no"
},
{
"velas": "no",
"bobina": "no",
"aquecedoras": "no",
"sensores": "no",
"terminais": "no",
"cabos": "yes",
"especiais": "no"
}
]
}
I'm calling this json from my server, i need to sort in 2 different ways: First: Order by user that sells more product types Second: Order Alphabetically
So the output need to be something like:
- Users that sells 5 products
- Users that sells 4 products
- Users that sells 3 products
How can i do that?