I want to sort the collection by the fieldValue
based on the given fieldName
.
For example: sort the collection by fieldName = ‘Author’
My problem: I am unable to get the value from the collection, like I want to add a field for authorValue.
The structure:
[
{
"sections": [
{
name: "section1",
fields: [
{
fieldName: "Author",
fieldValue: "John"
},
{
fieldName: "Movie",
fieldValue: "Avenger"
}
]
}
]
},
{
"sections": [
{
name: "section1",
fields: [
{
fieldName: "Author",
fieldValue: "Hengry"
},
{
fieldName: "Movie",
fieldValue: "Test"
}
]
}
]
}
]