xk6_mongo

package module
v0.0.0-...-07aead0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

README

xk6-mongo

This is an extension for performing MongoDB load testing using k6

Build

xk6 build --with github.com/Bounteous17/xk6-mongo

Development

In my case this repository is cloned at /projects/my/xk6-mongo

This would allow you to import the local development version on your k6 Javascript tests by using:

xk6 build --with github.com/Bounteous17/xk6-mongo=/projects/my/xk6-mongo

You can now test your local changes by importing the new module build:

import xk6_mongo from 'k6/x/mongo';

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is the Mongo client wrapper.

func (*Client) DeleteOne

func (c *Client) DeleteOne(database string, collection string, filter interface{}) error

func (*Client) DropDatabase

func (c *Client) DropDatabase(database string) error

func (*Client) Find

func (c *Client) Find(database string, collection string, filter interface{}) []bson.M

func (*Client) FindOne

func (c *Client) FindOne(database string, collection string, filter map[string]string) error

func (*Client) InsertOne

func (c *Client) InsertOne(database string, collection string, doc map[string]string) error

type Mongo

type Mongo struct{}

Mongo is the k6 extension for a Mongo client.

func (*Mongo) NewClient

func (*Mongo) NewClient(connURI string) interface{}

NewClient represents the Client constructor (i.e. `new mongo.Client()`) and returns a new Mongo client object. connURI -> mongodb://username:password@address:port/db?connect=direct

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL