Hi all,
I have a task to consume rest API and save the data into database.
the format of json is like this :
[{
“id”:123,
“phone”:123,
“experience”:[{
“a”:1,
“b”:1,
}],
“test”:aa
}]
so i create a document, inside the document i add document list which contain string id,phone,experience, document list (experience) that contain string a,b, and string test.
the rest API i call with pub.http.client withe get method, and i set loadAs as stream.
After that the stream i map into string with pub:io:streamToString and create a document with jsonStringToDocument.
I run the flow and it success, the document show the document list with structure $rootArray and inside it $rootArray[0],[1],etc.
So i insert map step, and drag my created doc into pipeline out, let say my doc name is doc_a.
I try to expand document from pipeline in but there is no sub document at all, so i direct connecting both document and i run the service, and the result my doc_a is not mapped with document generated from jsonStringToDocument.
Please help me how to do the map? or any advise and instruction
Thank you