I do iOS front-end mainly but am trying to finish up an MVP for a client with a nascent MongoDB on the backend. I've designed some social DB schemas but nothing with a hierarchy like this.
Basically the client wants all possible products divided into 5 levels of hierarchy - it's an inventory schema for small market stores. Examples would be:
Dry Goods > Drinks > Coffee & Tea > Light Roasts > French
Meat & Seafood > Whole Animals > Beef > Loin > Tritip
My initial thought is to make a main Product object. This would be the most specific item in the examples - French or Tritip. Then have 4 keys for all the more general categories in this Product object, with each of the preceding categories having their own tables, eg:
Level_0 == Meat & Seafood
Level_1 == Whole Animals
Level_2 == Beef
Level_3 == Loin
Product == Tritip
However, I feel like this is wrong. I'm wondering if I need 4 distinct tables for all the super categories. The inventory management schemas I have seen online don't have this many super categories, and so I could find a good example.
I know this is something that is out of my domain but the client wants something workable and I want to make it as robust as possible to withstand a few iterations of the product.
Aucun commentaire:
Enregistrer un commentaire