Skip to main content
This feature is currently in beta and is subject to change. If you are interested in testing it out, please reach out to us via Discord or email out support.
MongoDB instrument to measure the performance of queries directly in the CI.

Getting Started

Prerequisites

  • MongoDB instrument enabled in your CodSpeed account (reach out to us to enable)
  • MongoDB instance running in your CI environment or the cloud
We recommend: - using the art049/mongodb-cluster-action to run MongoDB in your CI environment - dynamic setup of a MongoDB instance during the setup phase of the benchmarks is supported, using tools such as testcontainers or vitest-mongodb

Activate the mongodb instrument in the CodSpeed Action

To activate the MongoDB instrument during the run of your benchmarks in the CodSpeed Action, make the following changes to your workflow file:
Using mongo-uri-env-nameIf using the mongo-uri-env-name option, make sure to set the actual value of the environment variable in the env section of your workflow file. Otherwise, the MongoDB instrument will not be able to connect to your MongoDB instance.
Dynamic connection stringIf the value of connection string cannot be set in the workflow file, you can omit the mongo-uri-env-name option and provide the connection string dynamically during the setup phase of your benchmarks.

Language specific examples

If you are using the mongo-uri-env-name option, the integration should work out of the box at this stage 🎉However, if you are not using the mongo-uri-env-name option, you will have to provide the connection string dynamically during the setup phase of your benchmarks. Select your language below to see how to do that.
To view examples and how to dynamically provide the connection string during the setup phase of your benchmarks, select your language below:

Node.js

  • Python: Not supported yet (coming soon)
  • Rust: Not supported yet (coming soon)