Structuring MongoDB Database and Collections for reduced redundancy

Viewed 19

I am importing data from an excel sheet which has 701 rows/records, but there are columns which contains redundant information.....

In my case for example - there are only 6 unique products and 5 Unique Countries but they are repeated in those 701 rows. My task is to Export all that data to MongoDB.

How should I structure my Database, should I create 2 collections i.e products, countries which will contain all unique data and then store their reference for each document in collection where my excel data will be stored?

This is the Document structure for now
[
  {
    country: 'CountryName',
    segment: 'BusinessType',
    product: 'Some Product',
    discountBand: 'High',
    unitsSold: 2574,
    grossSales: 772200,
    profit: 12870,
    dateTimeInUTC: 1383244190000,
    dateTime: 2013-10-31T18:29:50.000Z
  }
]
0 Answers
Related