service

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Database *mongo.Database

Functions

func CountDocuments added in v1.4.0

func CountDocuments(collection string, data primitive.M) (int64, error)

get len Documents checkCollectionExist is to check collection exist or not

func DBConnection

func DBConnection(c *mongo.Database)

DBConnection ..

Types

type CreateService

type CreateService struct{}

CreateService is to handle create function relation db query

func (CreateService) InsertManyDocuments

func (createservice CreateService) InsertManyDocuments(data []interface{}, collection string) (interface{}, error, bool)

InsertManyDocuments is to insert many document

func (CreateService) InsertOneDocument

func (createservice CreateService) InsertOneDocument(data map[string]interface{}, collection string) (interface{}, error, bool)

InsertOneDocument is to insert one document

func (CreateService) UpdateDocuments

func (createservice CreateService) UpdateDocuments(condition interface{}, data interface{}, collection string) (interface{}, error, bool)

UpdateDocuments is to insert many document

type DeleteService

type DeleteService struct{}

DeleteService is to handle Delete function

func (DeleteService) DeleteMany

func (deleteservice DeleteService) DeleteMany(filter interface{}, coll string) (interface{}, error, bool)

DeleteMany is for Delete document

func (DeleteService) DeleteManyWithFilter

func (deleteservice DeleteService) DeleteManyWithFilter(filter interface{}, data interface{}, coll string) (interface{}, error, bool)

UpdateDocuments is to insert many document

func (DeleteService) FindOneAndDelete

func (deleteservice DeleteService) FindOneAndDelete(filter interface{}, coll string) (interface{}, error, bool)

FindOneAndDelete is for Delete document

func (DeleteService) FindOneAndUpdate

func (deleteservice DeleteService) FindOneAndUpdate(filter interface{}, arrayFilter []interface{}, update interface{}, coll string) (interface{}, error, bool)

FindOneAndUpdate is for update document

type InitService

type InitService struct{}

InitService is to handle create function relation db query

type ReadService

type ReadService struct{}

ReadService is to handle create function relation db query

func (ReadService) AggregateDocument

func (readservice ReadService) AggregateDocument(data []bson.M, collection string) (interface{}, error, bool)

AggregateDocument is to read documents

func (ReadService) FindDocument

func (readservice ReadService) FindDocument(filter bson.M, projection bson.M, collection string, sort interface{}, limit int64, skip int64) (interface{}, error, bool)

func (ReadService) FindDocumentCount

func (readservice ReadService) FindDocumentCount(filter bson.M, projection bson.M, collection string, sort interface{}, limit int64, skip int64) (interface{}, error, bool)

func (ReadService) FindOneDocument added in v1.9.0

func (readservice ReadService) FindOneDocument(filter bson.M, projection bson.M, collection string, sort interface{}, skip int64) (interface{}, error, bool)

type UpdateService

type UpdateService struct{}

UpdateService is to handle update function

func (UpdateService) FindOneAndReplace

func (updateservice UpdateService) FindOneAndReplace(filter interface{}, update interface{}, coll string) (interface{}, error, bool)

FindOneAndReplace is for replace document

func (UpdateService) FindOneAndUpdate

func (updateservice UpdateService) FindOneAndUpdate(filter interface{}, arrayFilter []interface{}, update interface{}, coll string) (interface{}, error, bool)

FindOneAndUpdate is for update document

func (UpdateService) UpdateManyDocuments

func (updateservice UpdateService) UpdateManyDocuments(condition interface{}, data interface{}, coll string) (interface{}, error, bool)

UpdateDocuments is to insert many document

Jump to

Keyboard shortcuts

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