mongo

package
v0.0.0-...-aad8beb Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAll

func FindAll(ctx context.Context, collectionName string, query bson.M) ([]interface{}, error)

func FindOne

func FindOne(ctx context.Context, collectionName string, query bson.M, object interface{}) error

func GetMongoClient

func GetMongoClient(context context.Context) (*mongo.Client, error)

GetMongoClient return a copy of mongodb session

func Insert

func Insert(ctx context.Context, collectionName string, objectToInsert interface{}) error

Insert a new object on database

func Remove

func Remove(ctx context.Context, collectionName string, query bson.M) error

func Update

func Update(ctx context.Context, collectionName string, objectID bson.ObjectId, objectToUpdate interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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