Documentation ¶
Overview ¶
Package common provides functions shared between different parts of the connector.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetMongoCollection ¶
func GetMongoCollection(ctx context.Context, client *mongo.Client, db, collection string) (*mongo.Collection, error)
GetMongoCollection checks if the provided database and collection exist in a Mongo instance the client is connected to, and returns the mongo.Collection if they exist. By default, the Go Mongo driver creates a database and collection if they don't exist, so this function may come in handy when it comes to validations.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.