itrmg

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 6 Imported by: 1

README

itrmg

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteOneByID

func DeleteOneByID(dbName, collName string, client *mongo.Client, objID string) (bool, error)

DeleteOneByID delete a single row filetered MongoDB object ID from a MongoDB collection.

func FindOneByID

func FindOneByID(dbName, collName string, client *mongo.Client, objID string) (bool, error)

FindOneByID find a single row filtered by MongoDB object ID from a collection.

func InitMG

func InitMG(dbConStr string) error

InitMG initializes the MongoDB connections.

func InsertOne

func InsertOne(dbName, collName string, client *mongo.Client, data DP) (bool, error)

InsertOne insert one row in MongoDB collection.

func UpdateOne

func UpdateOne(dbName, collName string, client *mongo.Client, data DP, filter bson.M) (bool, error)

UpdateOne update a single row in MongoDB collection.

func UpdateOneByID

func UpdateOneByID(dbName, collName string, client *mongo.Client, data DP, objID string) (bool, error)

UpdateOneByID update a single row filtered by MongoDB object ID from a MongoDB collection.

Types

type DP

type DP map[string]interface{}

DP type is a collection of parameters.

func Find

func Find(dbName, collName string, client *mongo.Client, filter DP) (DP, error)

Find find a multiple rows filtered by MongoDB object ID from a collection.

Jump to

Keyboard shortcuts

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