How to get in presto/trino as JSON object columns from mongo?

303 Views Asked by At

I am trying to get in presto, the JSON saved in mongo as Object Using: https://prestodb.io/docs/current/connector/mongodb.html

I am looking for some way to convert a composite column to a JSON

select id, AS_JSON_STRING(en)
from cities

Example collection

cities
{
   en: { description: "New york", price: 100}
}
1

There are 1 best solutions below

0
ebyhr On

Trino MongoDB connector supports JSON type. You need to update _schema collection directly for changing the column type. https://trino.io/docs/current/release/release-360.html#mongodb-connector