Open Cp3022 opened 1 year ago
why do we get NULL values at the root level. (null, null, null, null, null, null, null, null, null, null)?
Input json:
{ "0000100001": { "10": [ { "id": "0000301010", "name": "ATR42/72, Initial Pilot", "code": "017IP", "description": "desc", "division": { "id": "10", "name": "Flight / Pilot", "courses": [] }, "manufacturer": "amnu", "program": { "id": "0000100001", "name": "ATR 42/72", "divisions": [] } } ], "30": [ { "id": "0000301011", "name": "ATR42/72, Recurrent Pilot", "code": "017RP", "description": null, "division": { "id": "10", "name": "Flight / Pilot", "courses": [] }, "manufacturer": null, "program": { "id": "0000100001", "name": "ATR 42/72", "divisions": [] } } ] } }
Spec:
[ { "operation": "shift", "spec": { "0000100001": { //program level key "*": { //division level "*": { //each array record "id": "[&2].divisions.course.id", "name": "[&2].divisions.course.name", "code": "[&2].divisions.course.code", "division": { "id": "[&3].divisions.id", "name": "[&3].divisions.name" }, "program": { "id": "[&3].id", "name": "[&3].name" } } } } } } ]
Results:
[ null, null, null, null, null, null, null, null, null, null, { "divisions" : { "course" : { "id" : "0000301010", "name" : "ATR42/72, Initial Pilot", "code" : "017IP" }, "id" : "10", "name" : "Flight / Pilot" }, "id" : "0000100001", "name" : "ATR 42/72" }, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, { "divisions" : { "course" : { "id" : "0000301011", "name" : "ATR42/72, Recurrent Pilot", "code" : "017RP" }, "id" : "10", "name" : "Flight / Pilot" }, "id" : "0000100001", "name" : "ATR 42/72" } ]
Thanks
why do we get NULL values at the root level. (null, null, null, null, null, null, null, null, null, null)?
Input json:
Spec:
Results:
Thanks