mongodb

package
v0.0.0-...-5aa440a Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB

func OpenDB(dsn string) (*mongo.Client, error)

Types

type PersonModel

type PersonModel struct {
	// contains filtered or unexported fields
}

func NewPersonModel

func NewPersonModel(client *mongo.Client) *PersonModel

func (*PersonModel) Get

func (m *PersonModel) Get(id string) (*models.Person, error)

This will return a specific person based on its id.

func (*PersonModel) GetAll

func (m *PersonModel) GetAll() ([]*models.Person, error)

This will return all the created persons.

func (*PersonModel) Remove

func (m *PersonModel) Remove(id string) (int64, error)

func (*PersonModel) Update

func (m *PersonModel) Update(id, firstName, lastName, email string, encodings []string) (string, error)

This will insert a new person into the database or updates existing.

Jump to

Keyboard shortcuts

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