mongo

package
v0.15.6 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mongo

type Mongo struct {
	// contains filtered or unexported fields
}

Mongo contains functions for agency mongodb.

func New

func New(db *mongo.Database, oldAge int) *Mongo

New to create new agency mongodb.

func (*Mongo) GetAll

func (m *Mongo) GetAll(ctx context.Context, data entity.GetAllRequest) ([]entity.Agency, int, int, error)

GetAll to get all.

func (*Mongo) GetAllIDs

func (m *Mongo) GetAllIDs(ctx context.Context) ([]int64, int, error)

GetAllIDs to get all ids.

func (*Mongo) GetByID added in v0.8.0

func (m *Mongo) GetByID(ctx context.Context, id int64) (*entity.Agency, int, error)

GetByID to get by id.

func (*Mongo) GetCount added in v0.14.0

func (m *Mongo) GetCount(ctx context.Context) (int, int, error)

GetCount to get count.

func (*Mongo) GetOldIDs

func (m *Mongo) GetOldIDs(ctx context.Context) ([]int64, int, error)

GetOldIDs to get old ids.

func (*Mongo) IsOld

func (m *Mongo) IsOld(ctx context.Context, id int64) (bool, int, error)

IsOld to check if old data.

func (*Mongo) UpdateByID

func (m *Mongo) UpdateByID(ctx context.Context, id int64, data entity.Agency) (int, error)

UpdateByID to update by id.

Jump to

Keyboard shortcuts

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