mongodb

package
v0.0.0-...-f7e1526 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 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 RewardModel

type RewardModel struct {
	C *mongo.Collection
}

func (*RewardModel) All

func (m *RewardModel) All() ([]models.Reward, error)

func (*RewardModel) FindById

func (m *RewardModel) FindById(id string) (*models.Reward, error)

FindByID finds a reward by id

func (*RewardModel) FindByName

func (m *RewardModel) FindByName(name string) (*models.Reward, error)

FindByRewardname finds a reward by rewardname

func (*RewardModel) InsertReward

func (m *RewardModel) InsertReward(reward *models.Reward) (*mongo.InsertOneResult, error)

InsertReward inserts a new reward to the database

func (*RewardModel) UpdateReward

func (m *RewardModel) UpdateReward(reward *models.Reward) (*mongo.UpdateResult, error)

UpdateReward updates the reward with the given id when posts, comments or subscribes are added/removed/updated

Jump to

Keyboard shortcuts

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