database

package
v0.0.0-...-81dbdb3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClient

func GetClient() *mongo.Client

func GetCollection

func GetCollection(name string) *mongo.Collection

func GetDB

func GetDB() *mongo.Database

func GetUserCol

func GetUserCol() *mongo.Collection

Types

type Collection

type Collection[T any] interface {
	GetOne(filter interface{}) *mongo.SingleResult
	GetList(filter interface{}) []T
	Create(data interface{}) *mongo.InsertOneResult
	Update(data interface{}, filter interface{}) *mongo.UpdateResult
	Delete(filter interface{}) *mongo.DeleteResult
}

UNUSED

Jump to

Keyboard shortcuts

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