ObjectiveGet a good schema capable of making searches easy depending on the hierarchy.BackgroundI am coding a database for a webervice that will return information about items for a game called Warframe. I am using MongoDB, and so far I came up with the following hierarchy that I think makes sense:In this hierarchy, I am trying to code the mods branch. A mod is like a card that you can equip on your player, weapon or companion (AI bot that follows you) and give it special properties. CodeTo achieve this I came up with the following schema:let modSchema = {    name: {        type: String,        required: true    },    description: {        type: String,        required: true    },    rarity: {        level: {            enum: [Common, Uncommon, Rare, Primed],            required: true        },        type: {            enum: [Normal, Nightmare, Corrupted, Syndicate] //(Only if rarity.level == Rare)        }    },    traddingTax: {        type: Number    },    rank: {        type: Number    },    transmutable: {        type: Boolean    },    featuredBuilds: [{        type: String,        match: /^http:\/\//i    }],    wikiaLink: {        type: String,        match: /^http:\/\//i,        required: true    },    updated: {        type: Date,        default: Date.now    },    modType: {        type: {            enum: [Warframe, Rifle, Pistol, Shotgun, Melee, Sentinel, Kubrow, Kavat],            required: true        }    },    gameType: {        type: {            enum: [Cooperative, Conclave, Archwing],            required: true        }    },    userTypDe: {        type: {            enum: [Player, Companion],            required: true        }    }};I have also watched this youtube tutorial video on shcemmas: https://www.youtube.com/watch?v=T5Yt6Ndm2QYExamples of user actionsFollowing or some actions a user may take when using the REST API I am building. They come in no particular order of importance:Get all primary mods in gameGet all Cooperative mods in gameGet all the warframe mods for a player in the Coop game typeCheck all the categories of the coop game typeCheck all categories of modsGet detailed information about a specific modQuestions:One of my objectives is to make a search by hierarchy easy to do, but I am unsure on how to do it. The video teaches how to include schemas inside other schemas, but I fail to see how that helps me here. How do I change my DB so it is easy to search by hierarchies?Another question that I have, is that as you can see, I have several Player and companion branches. Is this not going to cause a conflict?I would like an overall suggestion on how to improve my schema, since this is my first one and I am very unsure if I am doing it properly.
MongoDB design schema
database design;mongodb;schema