JSON
I'm converting a lot of data for export from MongoDB -> Postgresql
I would like an aggregation function to convert an object to JSON
{
"$addField": {
"_id": true,
"json": {
'$convert': {
'input': '$subdocument',
'to': 'json', # // Idealy, +1 for msgpack https://msgpack.org/
}
}
}
}
thus object.json would be a STRING "{abc: true}"
FYI: Postgresql supports JSON(B) in it's field structures: https://www.postgresql.org/docs/current/datatype-json.html
1
vote
Daniel
shared this idea