mongodb

package
v0.0.0-...-def7144 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultMongoClientOptions

func DefaultMongoClientOptions(mongoCfg config.Connection) *options.ClientOptions

DefaultMongoClientOptions constructs connection params to the pointer of options.ClientOptions. It can also chain call to overwrite default value.

func NewMongoConnection

func NewMongoConnection(mongoCfg config.Connection, ctx context.Context, opts ...*options.ClientOptions) (*mongo.Client, error)

NewMongoConnection initializes connection params with configurations.

Types

type CommonField

type CommonField struct {
	Initial     bool               `bson:"initial"`
	Description string             `bson:"description"`
	CreatedAt   primitive.DateTime `bson:"created_at"`
	UpdatedAt   primitive.DateTime `bson:"updated_at"`
}

func (CommonField) GetBSON

func (f CommonField) GetBSON() (interface{}, error)

func (CommonField) SetBSON

func (f CommonField) SetBSON(raw bson.RawValue) error

func (CommonField) UnmarshalBSON

func (f CommonField) UnmarshalBSON([]byte) error

See

Jump to

Keyboard shortcuts

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