models

package
v0.0.0-...-8dc607c Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HOST     = "127.0.0.1:27017"
	DBSOURCE = "Movies"
	USERNAME = "service_test"
	PASSWORD = "123456"
)

Variables

This section is empty.

Functions

func Find

func Find(db, collection string, query, selector, result interface{}) error

func FindAll

func FindAll(db, collection string, query, selector, result interface{}) error

func Insert

func Insert(db, collection string, docs ...interface{}) error

func Remove

func Remove(db, collection string, query interface{}) error

func Update

func Update(db, collection string, query, update interface{}) error

Types

type Movies

type Movies struct {
	Id          bson.ObjectId `bson:"_id" json:"id"`
	Name        string        `bson:"name" json:"name"`
	Time        string        `bson:"time" json:"time"`
	Description string        `bson:"description" json:"description"`
}

func (*Movies) FindAllMovies

func (m *Movies) FindAllMovies() ([]Movies, error)

func (*Movies) FindMovieById

func (m *Movies) FindMovieById(id string) (Movies, error)

func (*Movies) FindMovieByName

func (m *Movies) FindMovieByName(name string) (Movies, error)

func (*Movies) InsertMovie

func (m *Movies) InsertMovie(movie Movies) error

func (*Movies) RemoveMovieById

func (m *Movies) RemoveMovieById(id string) error

func (*Movies) UpdateMovie

func (m *Movies) UpdateMovie(movie Movies) error

Jump to

Keyboard shortcuts

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