Documentation ¶
Index ¶
- type Client
- func (c *Client) DeleteMany(database string, collection string, filter map[string]string) error
- func (c *Client) DeleteOne(database string, collection string, filter map[string]string) error
- func (c *Client) DropCollection(database string, collection string) error
- func (c *Client) FindAll(database string, collection string) []bson.M
- func (c *Client) FindMany(database string, collection string, filter string) []bson.M
- func (c *Client) FindOne(database string, collection string, filter string) bson.M
- func (c *Client) InsertMany(database string, collection string, docs []any) error
- func (c *Client) InsertOne(database string, collection string, doc string) error
- func (c *Client) UpdateOne(database string, collection string, filter interface{}, data map[string]string) error
- type Mongo
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) DeleteMany ¶
func (*Client) DropCollection ¶
func (*Client) InsertMany ¶
type Mongo ¶
type Mongo struct{}
Mongo is the k6 extension for a Mongo client.
func (*Mongo) MongoEncode ¶
func (*Mongo) NewClient ¶
NewClient represents the Client constructor (i.e. `new mongo.Client()`) and returns a new Mongo client object. The `connURI` parameter in the `NewClient` function is used to specify the connection URI for the MongoDB client. It typically follows the format `mongodb://username:password@address:port/db?connect=direct`. This URI contains information such as the username, password, address, port, database name, and connection options. connURI -> mongodb://username:password@address:port/db?connect=direct connURI -> mongodb+srv://username:password@address:port/db?authSource=admin