This is the complementary repository for our video How to use discriminators with Mongoose and MongoDB (channel @fromDev2Dev).
This is about how to have different schemas in a same MongoDB collection using discriminators. Discriminators provide a way to implement inheritance-like behavior in your data models. They allow you to define a base schema that can be extended or specialized by creating child schemas.
npm install
npm run test
Open a terminal in the project's root directory and run:
cd mongodb
docker-compose up -d
./init-db.sh
cd ..
npm run dev