mongodb

package
v0.0.0-...-44dc85e Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserModel

type UserModel struct {
	C *mongo.Collection
}

UserModel represent a mgo database session with a user model data.

func (*UserModel) All

func (m *UserModel) All() ([]models.User, error)

All method will be used to get all records from the users table.

func (*UserModel) Delete

func (m *UserModel) Delete(id string) (*mongo.DeleteResult, error)

Delete will be used to delete a user

func (*UserModel) FindByID

func (m *UserModel) FindByID(id string) (*models.User, error)

FindByID will be used to find a new user registry by id

func (*UserModel) Insert

func (m *UserModel) Insert(user models.User) (*mongo.InsertOneResult, error)

Insert will be used to insert a new user

Jump to

Keyboard shortcuts

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