dao

package
v0.0.0-...-c596874 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// COLLECTION is the name of the collection in MongoDB
	COLLECTION = "shopping_malls"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ShoppingMallsDAO

type ShoppingMallsDAO struct {
	Server   string
	Database string
}

ShoppingMallsDAO is the DAO structure

func (*ShoppingMallsDAO) Connect

func (m *ShoppingMallsDAO) Connect()

Connect connects to the MongoDB

func (*ShoppingMallsDAO) Delete

func (m *ShoppingMallsDAO) Delete(shoppingMalls ShoppingMall) error

Delete an existing shopping mall

func (*ShoppingMallsDAO) FindAll

func (m *ShoppingMallsDAO) FindAll() ([]ShoppingMall, error)

FindAll Find list of shopping malls

func (*ShoppingMallsDAO) FindByID

func (m *ShoppingMallsDAO) FindByID(id string) (ShoppingMall, error)

FindByID Find a shopping mall by its id

func (*ShoppingMallsDAO) FindByQuery

func (m *ShoppingMallsDAO) FindByQuery(city, score, sortField string, shopsToFind []string) ([]ShoppingMall, error)

FindByQuery Find a shopping mall by query

func (*ShoppingMallsDAO) Insert

func (m *ShoppingMallsDAO) Insert(shoppingMalls ShoppingMall) error

Insert a shopping mall into database

func (*ShoppingMallsDAO) Update

func (m *ShoppingMallsDAO) Update(shoppingMalls ShoppingMall) error

Update an existing shopping mall

Jump to

Keyboard shortcuts

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