common

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

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.

Jump to

Keyboard shortcuts

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