DataModel in NoSQL from multiple SQL tables

Lord Djaz Source

I have a database which look like this uploaded on a SQL Server :

Database Schema

And this specific scenario :

The airport web page allows viewers to see details of an airport together with the city that it serves including details such as the timezone and day light savings, a list of the airlines, and a list of destinations. Through other web pages it is possible to view details of airlines and the routes.

I manage to export it as CSV and convert my 5 CSV (one for each table) into 5 JSON files.

I have to nest them to create collections in order to upload them on a MongoDB server.

My issue is that I have to work on a Data Model first and I am pretty confuse. I am wondering how should I build it, I was thinking of doing 2 or maybe 3 collections :

Routes -> Airlines (-> Countries?)
Routes -> Airports -> Cities -> Countries

or

Routes -> Airlines -> Countries
Airports -> Cities -> Countries
Routes -> Airports

The thing is that I am not supposed to do a single collection about airports which nests information about the cities, airlines, and routes. While it is possible to nest everything within such a model, I have to consider the specific scenario.

My other question is about a method which will allow me to nest the data properly. I know I can do a python script or something like this, but regarding that I have to then upload my data on a MongoDB Server, I was wondering if there is a command or something that will help me to nest my data an create the architecture I want regarding my model.

Thank's a lot guys. Cheers !

I kinda answer my first question by myself reading again and again properly the Scenario. I will have something like :

Airports -> Cities -> Countries
Routes / -> Airlines / -> Airports

And I finally did a Python script to achieve the merging. If someone know if it's possible to do this inside MongoDB, I am really interested.

Thanks :)

sqljsondatabasemongodbnosql

Answers

answered 1 week ago Lord Djaz #1

I kinda answer my first question by myself reading again and again properly the Scenario. I will have something like :

Airports -> Cities -> Countries
Routes / -> Airlines / -> Airports

And I finally did a Python script to achieve the merging. If someone know if it's possible to do this inside MongoDB, I am really interested.

Thanks :)

comments powered by Disqus