mongoRepository

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoEntity

type MongoEntity[ID MongoEntityId] interface {
	gpa.Entity[ID]
	Collection() string
}

type MongoEntityId

type MongoEntityId interface {
	gpa.Id
}

type MongoRepository

type MongoRepository[E MongoEntity[ID], ID MongoEntityId] interface {
	gpa.CrudRepository[E, ID]
}

func NewMongoRepository

func NewMongoRepository[E MongoEntity[ID], ID MongoEntityId](collection *mongo.Collection, ctx context.Context) MongoRepository[E, ID]

type MongoRepositoryImpl

type MongoRepositoryImpl[E MongoEntity[ID], ID MongoEntityId] struct {
	// contains filtered or unexported fields
}

func NewMongoRepositoryImpl

func NewMongoRepositoryImpl[E MongoEntity[ID], ID MongoEntityId](collection *mongo.Collection, ctx context.Context) *MongoRepositoryImpl[E, ID]

func (*MongoRepositoryImpl[E, ID]) Delete

func (m *MongoRepositoryImpl[E, ID]) Delete(e E) (err error)

func (*MongoRepositoryImpl[E, ID]) DeleteAll

func (m *MongoRepositoryImpl[E, ID]) DeleteAll(e ...E) (count int64, err error)

func (*MongoRepositoryImpl[E, ID]) DeleteAllById

func (m *MongoRepositoryImpl[E, ID]) DeleteAllById(id ...ID) (count int64, err error)

func (*MongoRepositoryImpl[E, ID]) DeleteById

func (m *MongoRepositoryImpl[E, ID]) DeleteById(id ID) (err error)

func (*MongoRepositoryImpl[E, ID]) FindAllById

func (m *MongoRepositoryImpl[E, ID]) FindAllById(id ...ID) (e []E, err error)

func (*MongoRepositoryImpl[E, ID]) FindById

func (m *MongoRepositoryImpl[E, ID]) FindById(id ID) (e E, err error)

func (*MongoRepositoryImpl[E, ID]) Save

func (m *MongoRepositoryImpl[E, ID]) Save(e E) (err error)

func (*MongoRepositoryImpl[E, ID]) SaveAll

func (m *MongoRepositoryImpl[E, ID]) SaveAll(e ...E) (count int64, err error)

Jump to

Keyboard shortcuts

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