Documentation ¶
Index ¶
- Variables
- func CloseConnections()
- func DeleteAllDoc(dbName, collectionName, query string) int64
- func DeleteOneDoc(dbName, collectionName, query string) int64
- func GetClient(connString string)
- func InsertManyDoc(trainer []interface{}, dbName, collectionName string) interface{}
- func InsertOneDoc(trainer Trainer, dbName, collectionName string) interface{}
- func UpdateAllDoc(dbName, collectionName, updatedData, query string) int64
- func UpdateOneDoc(dbName, collectionName, updatedData, query string) int64
- type Trainer
Constants ¶
This section is empty.
Variables ¶
var Connclient *mongo.Client
Connclient holds connection handle It is best practice to keep a client that is connected to MongoDB around so that the application can make use of connection pooling.
Functions ¶
func CloseConnections ¶
func CloseConnections()
CloseConnections will close all the connections in the end if your application no longer requires a connection, the connection can be closed with client.Disconnect()
func DeleteAllDoc ¶
DeleteAllDoc will retune find results
func DeleteOneDoc ¶
DeleteOneDoc will retune find results
func InsertManyDoc ¶
func InsertManyDoc(trainer []interface{}, dbName, collectionName string) interface{}
InsertManyDoc insert a new document
func InsertOneDoc ¶
InsertOneDoc insert a new document
func UpdateAllDoc ¶
UpdateAllDoc update the info of a informed Hero
func UpdateOneDoc ¶
UpdateOneDoc update the info of a informed Hero
Types ¶
type Trainer ¶
Trainer struct represent a trainer details
func FindAllDocs ¶
FindAllDocs return all documents from the collection Heroes
func FindOneDoc ¶
FindOneDoc will retune find results