post

package
v0.0.0-...-5305c49 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 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

Types

type Post

type Post struct {
	ID          primitive.ObjectID `bson:"_id" json:"id"`
	CreatedBy   primitive.ObjectID `bson:"created_by" json:"created_by"`
	Title       string             `bson:"title" json:"title"`
	Description string             `bson:"description" json:"description"`
	Tags        []string           `bson:"tags" json:"tags"`
	Thumbnail   primitive.ObjectID `bson:"thumbnail" json:"thumbnail"`
	CreatedAt   time.Time          `bson:"created_at" json:"created_at"`
}

func Find

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

func FindOne

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

func (*Post) Delete

func (p *Post) Delete() error

func (*Post) Insert

func (p *Post) Insert() error

func (*Post) Save

func (p *Post) Save() error

func (*Post) Update

func (p *Post) Update() error

Jump to

Keyboard shortcuts

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