Every core API in the documentation site should map, as much as possible, to an example that can run directly inside the current repository.
See the official examples index for the full source list.
npm run test:examplescompiles and executes the current 59 TypeScript examples.examples/helpers/bootstrap.tsis a helper module and is not executed on its own.examples/docs/vector-search.tsexits without calling Search whenMONSQLIZE_VECTOR_SEARCH_URIandMONSQLIZE_ATLAS_LOCAL_URIare unset.
npm run build
npm run test:examplesnpm run test:examples starts a shared mongodb-memory-server standalone instance and replica set in the parent process. It performs health checks between examples and passes the URI to every example child process. Binary cache is fixed at .cache/mongodb-memory-server/binaries, while temporary data directories are fixed at .cache/mongodb-memory-server/db and cleaned up on exit.
You can also run any example individually:
tsc -p tsconfig.examples.json
node .generated/examples-dist/examples/docs/find.js| Document | Example |
|---|---|
getting-started.md |
examples/quick-start/basic-connect.ts |
basic-operations.md |
examples/quick-start/basic-operations.ts |
cache.md |
examples/docs/cache-multilevel.ts |
Some conceptual pages intentionally reuse the same richer example instead of duplicating nearly identical scripts for every heading. The complete source of truth is the official examples index.