mongo

package
v0.0.0-...-b6e1ce4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model[T any] struct {
	*mongo.Model
}

func MustNew

func MustNew[T any](url, collection string) *Model[T]

func (*Model[T]) Delete

func (m *Model[T]) Delete(id string) error

func (*Model[T]) Find

func (m *Model[T]) Find(options *options.ListOptions) (ret []T, count int, err error)

func (*Model[T]) FindOne

func (m *Model[T]) FindOne(id string) (T, error)

func (*Model[T]) Insert

func (m *Model[T]) Insert(data T) error

func (*Model[T]) Query

func (m *Model[T]) Query(attr map[string]interface{}) (T, error)

func (*Model[T]) Update

func (m *Model[T]) Update(attr map[string]interface{}, data T) error

Jump to

Keyboard shortcuts

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