CLI demo that runs a series of queries against a database, creates indexes, shows the explain output and provides context for what is happening and why. It uses the MongoDB Node.js driver and vanilla EJS modules.
This was created as a way for me to wrap my head around compound indexes and see how the order of fields within a compound index has an impact on query performance.
- Run
yarnto install deps - Add your connection string (local or Atlas) to
.env.exampleand rename it to.env - Run
yarn seedto populate the database - Run
yarn startto start the demo