I have a json query that gives me json of a joined table of person and pets:
SELECT json_object(
  'personId', p.id,
  'pets', json_arrayagg(json_object(
    'petId', pt.id,
    'petName', pt.name
  ))
  )
FROM person p LEFT JOIN pets pt
ON p.id = pt.person_id
GROUP BY p.id;
what would be the best way to export the result to json file that I can use mongoimport to load them to mongo?
im using some db client called TablePlus and their json export is weird, corrupting the date :\
 
    