mongoDB testing


Using k6, can we connect to mongo DB and execute statements to fetch or insert in to collection?
If yes, more info or any link to documentation will help a lot


1 Like

We don’t support MongoDB in core k6 yet, sorry. Looking around, it seems like someone from the k6 community has created a MongoDB xk6 extension recently though: GitHub - b1uema/xk6-mongo: xk6-mongo

If that’s not enough for your needs, you can read more information about xk6 extensions here:

Usually, K6 is used to implement performance tests over API or webs. Those are the ones that connect to the database, so I recommend you implement an API that does that the way that simulates the system under load and then you use it from k6.
That would be the easiest.