I got stuck on integrating Nest JS with Cosmos DB Core SQL API. I am aware that there is a module for Cosmos DB (https://github.com/nestjs/azure-database) but I need the data schema to support nested json like this:
{
"id":"string",
"name":"string",
"start_date":2016-06-01T00:00:00.000Z,
"end_date":2016-06-01T00:00:00.000Z,
"current_status":{
"event_part_id":"string",
"media_type":"string",
"media_id":"string",
"media_time":int
},
"event_parts":[{
"id":"string",
"name":"string",
"timeline_id":"string",
"user_voice_chat":boolean,
"surveys":[{
"id":"string",
"name":"string",
"question":"string",
"answers":[{
"id":"string",
"name":"string"
}],
}],
"images":[{
"id":"string",
"name":"string",
"url":"string"
}],
"videos":[{
"id":"string",
"name":"string",
"url":"string"
}],
"live_streaming":{
"id":"string",
"name":"string",
"url":"string"
}
}],
"asset_id":"string",
"twitter_text":"string",
"rtc_network_room_id":"string",
"is_active":boolean
}
Which I think (or I'm probably wrong) the @nestjs/azure-database does not support, since when I checked their example and quickstart there is no example for such json schema.
Is it possible to use @nestjs/azure-database or do I need to create a custom database module for this?
I am also aware that there is an option to use Cosmos DB MongoDB API and use TypoORM or Sequelize for this, but internally we want to keep using Cosmos DB SQL API since we are already using it for several services.
Thanks!