I need to extract values from a JSON string so I can compare them. I only need to verify that they are in order (ascending/descending). I was going to check the first and second 'choices' and compare. I don't anything more advanced.
EDIT/UPDATE: How could I use wildcards (*) in this type of query to skip having each segment?
string one = (string)o[this.Context[*WILDCARD*]["cid1"]].ToString();
/* this works, but has too many []
string one = (string)o[this.Context["partner"]]
[this.Context["campaign"]]
[this.Context["segment1"]]
[this.Context["segment2"]]
[this.Context["qid2"]]
["community"]
[this.Context["cid1"]].ToString();
*/
{
"partner": {
"campaign": {
"round1": {
"round2": {
"def123": {
"community": {
"choicec": 28
},
"user": {
"choice": "choicec",
"writeDateUTC": "2015-06-15T17:21:59Z"
}
}
},
"abc321": {
"community": {
"choicec": 33
},
"user": {
"choice": "choicec",
"writeDateUTC": "2015-06-15T17:21:59Z"
}
}
}
}
}
}