Database

package
v0.0.0-...-3e3ab8e Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBSON

func NewBSON(data interface{}, mode string) (interface{}, *Hermes.Log)

Types

type Connection

type Connection struct {
	AccessLevel int64
	Client      *mongo.Client
	Context     context.Context
	Cancel      context.CancelFunc
	Log         *Hermes.LogBook
	Database    *mongo.Database
	Collection  *mongo.Collection
	Selection   bson.D
	Sort        bson.M
	Options     *options.FindOptions
	Information map[string]string
}

func NewConnection

func NewConnection(service, username, password, cluster, url, customURL string, logbook *Hermes.LogBook) *Connection

func (*Connection) CheckConnection

func (c *Connection) CheckConnection() bool

func (*Connection) Create

func (c *Connection) Create(data interface{})

func (*Connection) CreateMany

func (c *Connection) CreateMany(data []interface{})

func (*Connection) Delete

func (c *Connection) Delete(filter bson.D)

func (*Connection) DeleteCollection

func (c *Connection) DeleteCollection()

func (*Connection) DeleteDatabase

func (c *Connection) DeleteDatabase()

func (*Connection) DeleteMany

func (c *Connection) DeleteMany(filter bson.D)

func (*Connection) Disconnect

func (c *Connection) Disconnect()

func (*Connection) Find

func (c *Connection) Find(data, filter interface{})

func (*Connection) FindMany

func (c *Connection) FindMany(data, filter interface{}) (results []interface{})

func (*Connection) RetrieveCollections

func (c *Connection) RetrieveCollections(filter bson.M) []string

func (*Connection) RetrieveDatabases

func (c *Connection) RetrieveDatabases(filter bson.M) []string

func (*Connection) SetConnectionCollection

func (c *Connection) SetConnectionCollection(collection string, filter bson.M)

func (*Connection) SetConnectionDatabase

func (c *Connection) SetConnectionDatabase(database string, filter bson.M)

func (*Connection) SetConnectionFilter

func (c *Connection) SetConnectionFilter(keys []string, values ...interface{})

func (*Connection) SetConnectionOptions

func (c *Connection) SetConnectionOptions(comment string, limit, skip int64, maxTime time.Duration, returnKey bool)

func (*Connection) SetConnectionSort

func (c *Connection) SetConnectionSort(field string, ascending bool)

func (*Connection) Update

func (c *Connection) Update(data interface{}, filter, update bson.D)

func (*Connection) UpdateMany

func (c *Connection) UpdateMany(data []interface{}, filter, update bson.D)

Jump to

Keyboard shortcuts

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