db

package
v0.0.0-...-61344ea Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IncrementBatchID

func IncrementBatchID(ctx context.Context, coll *mongo.Collection, collName string, batch int64) (int64, error)

func IncrementID

func IncrementID(ctx context.Context, coll *mongo.Collection, collName string) (int64, error)

func InitIncrementIDDoc

func InitIncrementIDDoc(ctx context.Context, coll *mongo.Collection, incrCollName string) error

func NewMongo

func NewMongo(dbsn, dbname string) (db *mongo.Database, cleanup func(), err error)

Types

type IncrementIDDoc

type IncrementIDDoc struct {
	Name   string `json:"name" bson:"name"`
	NextID int64  `json:"next_id" bson:"next_id"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳