You are not logged in.
Pages: 1
Is there any options for _JSON for resulting current level from nested json source ? i mean no nested result just current level. sorry my bad english.
Source :
{
"aaa": 0,
"bbb": 1,
"ccc" : {
c1: 0,
c2: 1,
c3: {
c31: 0,
c32: 1
}
}
}
Output expected for "var.ccc"
{
"c1": 0,
"c2": 1
}
Offline
Sorry ab, I only find Reduce method in TDocVariantData, but the result still have nested inside.
begin
fVar := _JSon('{"aaa":0,"bbb":1,"ccc":{c1:0,c2:1,c3:{c31:0,c32:1}}}');
_Safe(fVar)^.Reduce(['ccc'], false, fOut);
showmessage(fOut.tojson);
end
Result still have nested 'c3'
{"ccc":{c1:0,c2:1,c3:{c31:0,c32:1}}}
I need a function maybe look like
showmessage(fVar.ccc.CurrentLevel);
ccc -> {c1:0,c2:1}
root* -> {"aaa":0,"bbb":1}
c3 -> {c31:0,c32:1}
Offline
Navigate within the TDocVariantData.Values[] properties, using _Safe() to retrieve any nested object, and only getting what you need.
Your need is so specific we perhaps won't include it within the main TDocVariantData object.
Offline
Pages: 1