hi,
I have one small example:
var jsonObj = [{
"age": 30,
"name": "James Martin"
},
{
"age": 44,
"name": "ABC",
}
]
var family = jsonQ(JSON.stringify(jsonObj)),
pnames = family.find('name');
result ==> i am getting same result asc or desc sorting..this is happening only if i have Json array...Could you please suggest how to approach this kind of problem..Basically i have requirement where i need to do sorting based on column in json array..
pnames.sort("name",{order:'ASC'}).value()
["James Martin", "ABC"]
pnames.sort("name",{order:'DESC'}).value()
["James Martin", "ABC"]
hi, I have one small example: var jsonObj = [{ "age": 30, "name": "James Martin"
}, { "age": 44, "name": "ABC", } ]
var family = jsonQ(JSON.stringify(jsonObj)), pnames = family.find('name');
result ==> i am getting same result asc or desc sorting..this is happening only if i have Json array...Could you please suggest how to approach this kind of problem..Basically i have requirement where i need to do sorting based on column in json array.. pnames.sort("name",{order:'ASC'}).value() ["James Martin", "ABC"] pnames.sort("name",{order:'DESC'}).value() ["James Martin", "ABC"]