database

package
v0.0.0-...-cb9294f Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2018 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConditionToQuery

func AddConditionToQuery(condition []string, p bson.M) bson.M

AddConditionToQuery adds each condition to the map

func BuildQuery

func BuildQuery(query models.Query) bson.M

BuildQuery makes a query

func GetAll

func GetAll(collection string) []map[string]string

GetAll returns an array of all objects in a collection

func Hash

func Hash(s string) string

Hash hashes a string

func Init

func Init(dbName, connectionstring string)

Init creates a connection to the database

func Insert

func Insert(collection string, object interface{}) bool

Insert allows users to add generic objects to a collection in the database

func RemoveAll

func RemoveAll(collection string) bool

RemoveAll will empty a collection

func SetCollection

func SetCollection(collection string) *mgo.Collection

SetCollection sets the collection

func Update

func Update(collection string, selector interface{}, object interface{}) bool

Update allows users to add generic objects to a collection in the database

Types

This section is empty.

Jump to

Keyboard shortcuts

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