โ04-21-2021 09:52 PM
We need to merge multiple documents to single array and looking for help. Since it is ultra task, we are running out of optionsโฆ
Input data:
[
{โRecordโ: โ1โ},
{โRecordโ: โ2โ},
{โRecordโ: โ5โ},
{โRecordโ: โ4โ},
{โRecordโ: โ6โ}
]
Expected Output:
[ โresponseโ: [{โRecordโ: โ1โ}, {โRecordโ: โ2โ}, {โRecordโ: โ5โ}, {โRecordโ: โ4โ}, {โRecordโ: โ6โ}]
]
โ04-22-2021 09:05 AM
Thanks. but please see below, 40 documents went in and 0 out. if we put the write inside the while loop, it will write 40 documents in this case but we need the 40th document as the final result. if there is a way to take the last document, that will also help
โ04-22-2021 09:10 AM
@thilkip - what is generating the input documents?
โ04-22-2021 09:11 AM
a SQL snap gets the data from tables
โ04-22-2021 09:13 AM
SQL Server 2016 (13.x) and later has a โFOR JSONโ clause:
You should be able to return the result set exactly how you want.
โ04-22-2021 09:14 AM
the data coming from DB2