comment

package
v0.0.0-...-172aab7 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Count

func Count(filter bson.M) int

Count comments

Types

type Comment

type Comment struct {
	ID        primitive.ObjectID `bson:"_id" json:"id"`
	User      primitive.ObjectID `bson:"_user" json:"user"`
	Post      primitive.ObjectID `bson:"_post" json:"post"`
	Content   string             `bson:"content" json:"content"`
	CreatedAt time.Time          `bson:"created_at" json:"created_at"`
}

Comment Model

func Find

func Find(filter bson.M, page, limit int, sorts ...bson.E) []Comment

Find comments

func FindOne

func FindOne(filter bson.M) (*Comment, error)

FindOne comment

func (*Comment) Delete

func (c *Comment) Delete() error

Delete a comment

func (*Comment) Insert

func (c *Comment) Insert() error

Insert new Comment

func (*Comment) Save

func (c *Comment) Save() error

Save a Comment insert or update

func (*Comment) Update

func (c *Comment) Update() error

Update a Comment

Jump to

Keyboard shortcuts

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