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
yarn
to install deps - Add your connection string (local or Atlas) to
.env.example
and rename it to.env
- Run
yarn seed
to populate the database - Run
yarn start
to start the demo