1

I am using this online fattening script - https://jsfiddle.net/S2hsS . I am using. It is flatting plain array also. ie, I have an array in my json [43322, 454353, 56546] It converting

    "events.events[0]._source.Ids[0]": 43322,
    "events.events[0]._source.Ids[1]": 454353,
    "events.events[0]._source.Ids[2]": 56546,

But I need like this:

    "events.events[0]._source.Ids"=[43322, 454353, 56546]`

Problem, Actually, Id's count is around 20 to 2000+. We getting very very big fatterned file and it not needed also. so.

Sun
  • 3,444
  • 7
  • 53
  • 83
  • So why are you using that script instead of asking about how to write a better script? – Mike 'Pomax' Kamermans Mar 15 '21 at 04:30
  • I am not good in javascript, so there is modification needed on https://jsfiddle.net/S2hsS – Sun Mar 15 '21 at 05:14
  • Okay, but that's a very different problem. Can you explain why you're getting "20 to 2000+" ids? Is this your own API endpoint? If so, why does it not paginate? Also, JSON gets transmitted as compressed plain text, so even if the JSON itself looks huge, the actual data transmission was _tiny_ so what is the actual number of bytes that gets transferred? Because I'm pretty sure it's going to be so small as to make this the kind of optimization you should only do once you've optimized literally everything else. – Mike 'Pomax' Kamermans Mar 15 '21 at 16:26

0 Answers0