Documentation ¶
Index ¶
- type Database
- type Document
- type Documents
- type MongoDB
- func (db *MongoDB) AppendToList(collectionName string, filter map[string]interface{}, ...) (bool, error)
- func (db *MongoDB) CloseDB()
- func (db *MongoDB) Delete(collectionName string, filter map[string]interface{}) (bool, error)
- func (db *MongoDB) DeleteAll(collectionName string, filter map[string]interface{}) (bool, error)
- func (db *MongoDB) Get(collectionName string, filter map[string]interface{}, document Document) error
- func (db *MongoDB) GetAll(collectionName string, filter map[string]interface{}, documents Documents) error
- func (db *MongoDB) GetRandom(collectionName string, filter map[string]interface{}, limit int64, ...) error
- func (db *MongoDB) GetUniqueKeys(collectionName string, filter map[string]interface{}, fieldName string) ([]string, error)
- func (db *MongoDB) GetUniqueValues(collectionName string, filter map[string]interface{}, field string) ([]string, error)
- func (db *MongoDB) GetWithLimit(collectionName string, filter map[string]interface{}, limit int64, ...) error
- func (db *MongoDB) Insert(collectionName string, document Document) (bool, error)
- func (db *MongoDB) InsertMultiple(collectionName string, documents Documents) error
- func (db *MongoDB) Ping() bool
- func (db *MongoDB) RemoveCollection(collectionName string) error
- func (db *MongoDB) RemoveFromList(collectionName string, filter map[string]interface{}, subDocument SubDocument) (bool, error)
- func (db *MongoDB) RemoveObject(collectionName string, filter map[string]interface{}, ...) (bool, error)
- func (db *MongoDB) Update(collectionName string, filter map[string]interface{}, document Document) (bool, error)
- func (db *MongoDB) UpdateObject(collectionName string, filter map[string]interface{}, ...) (bool, error)
- type NewSubDocument
- type SubDocument
- type UpdateSubDocument
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database interface { Ping() bool Insert(collectionName string, document Document) (bool, error) InsertMultiple(collectionName string, documents Documents) error Get(collectionName string, filter map[string]interface{}, document Document) error GetAll(collectionName string, filter map[string]interface{}, documents Documents) error GetWithLimit(collectionName string, filter map[string]interface{}, limit int64, documents Documents) error GetRandom(collectionName string, filter map[string]interface{}, limit int64, documents Documents) error GetUniqueValues( collectionName string, filter map[string]interface{}, fieldName string, ) ([]string, error) GetUniqueKeys(collectionName string, filter map[string]interface{}, fieldName string) ([]string, error) Delete(collectionName string, filter map[string]interface{}) (bool, error) DeleteAll(collectionName string, filter map[string]interface{}) (bool, error) RemoveCollection(collectionName string) error Update(collectionName string, filter map[string]interface{}, document Document) (bool, error) UpdateObject(collectionName string, filter map[string]interface{}, subDocument UpdateSubDocument) (bool, error) RemoveObject(collectionName string, filter map[string]interface{}, subDocument UpdateSubDocument) (bool, error) AppendToList(collectionName string, filter map[string]interface{}, subDocument NewSubDocument) (bool, error) RemoveFromList(collectionName string, filter map[string]interface{}, subDocument SubDocument) (bool, error) }
type MongoDB ¶
type MongoDB struct { *mongo.Database Client *mongo.Client Logger *log.Logger Host string Port int Username string Password string Name string MaxConns int Timeout int }
func NewMongoDB ¶
func (*MongoDB) AppendToList ¶
func (*MongoDB) GetUniqueKeys ¶
func (*MongoDB) GetUniqueValues ¶
func (*MongoDB) GetWithLimit ¶
func (*MongoDB) InsertMultiple ¶
func (*MongoDB) RemoveCollection ¶
func (*MongoDB) RemoveFromList ¶
func (*MongoDB) RemoveObject ¶
func (*MongoDB) UpdateObject ¶
type NewSubDocument ¶
type SubDocument ¶
Click to show internal directories.
Click to hide internal directories.