ps_mongo

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnsureIndexes

func EnsureIndexes(ctx context.Context, collection *mongo.Collection, desiredIndexes []*NamedIndex)

func IsUniqueConstraintError

func IsUniqueConstraintError(err error, namedIndex *NamedIndex) bool

func New

func New(ctx context.Context, uri string) (*mongo.Database, func())

Types

type NamedIndex

type NamedIndex struct {
	Name       string
	Collection *mongo.Collection
	IndexModel mongo.IndexModel
}

type PSMongo

type PSMongo struct {
	Client *mongo.Client
	DB     *mongo.Database
}

func (*PSMongo) Disconnect

func (m *PSMongo) Disconnect(ctx context.Context)

Jump to

Keyboard shortcuts

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