product

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 Product

type Product 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"`
	Informations map[string]interface{} `bson:"informations" json:"informations"`
	Price        float64                `bson:"price" json:"price"`
	Quantity     int                    `bson:"quantity" json:"quantity"`
	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) ([]Product, error)

func FindOne

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

func (*Product) Delete

func (p *Product) Delete() error

func (*Product) Insert

func (p *Product) Insert() error

func (*Product) Save

func (p *Product) Save() error

func (*Product) Update

func (p *Product) Update() error

Jump to

Keyboard shortcuts

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