Hi,
I am getting JSON from my SQL Server - Select snap I want to convert it into NDJSON to push the data into ElasticSearch
example:-
the data from SQL server:
[
{
“Id”: “1”,
“Type”: “student”,
“Name”: “s one”,
“Age”: 27
},
{
“Id”: “2”,
“Type”: “teacher”,
“Name”: “t one”,
“Age”: 40
},
{
“Id”: “3”,
“Type”: “student”,
“Name”: “s two”,
“Age”: 16
},
{
“Id”: “4”,
“Type”: “teacher”,
“Name”: “t two”,
“Age”: 27
}
]
Format which ElasticSearch accept
{ “index” : { “_index”: “schoolindex”} }
{“Id”:“1”,“Type”:“student”,“Name”:“s one”,“Age”:27}
{ “index” : { “_index”: “schoolindex”} }
{“Id”:“2”,“Type”:“teacher”,“Name”:“t one”,“Age”:40}
{ “index” : { “_index”: “schoolindex”} }
{“Id”:“3”,“Type”:“student”,“Name”:“s two”,“Age”:16}
{ “index” : { “_index”: “schoolindex”} }
{“Id”:“4”,“Type”:“teacher”,“Name”:“t two”,“Age”:27}
which will be the best way to achieve the required format?
Any help will be greatly appreciated
Thank you