person_db

package
v0.0.0-...-753c707 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COLLECTION = "person"
)

Variables

This section is empty.

Functions

func MongoConnection

func MongoConnection(db *MongoDB) (*mongo.Client, *mongo.Collection)

func MongoDisconnect

func MongoDisconnect(client *mongo.Client)

Types

type MongoDB

type MongoDB struct {
	// contains filtered or unexported fields
}

func NewMongoDB

func NewMongoDB(config *person_config.Config) *MongoDB

func (*MongoDB) FindPersonByID

func (db *MongoDB) FindPersonByID(ctx context.Context, accountId string) ([]byte, error)

func (*MongoDB) FindPersonByPhone

func (db *MongoDB) FindPersonByPhone(ctx context.Context, phone string) ([]byte, error)

func (*MongoDB) FindPersonCrendential

func (db *MongoDB) FindPersonCrendential(ctx context.Context, _id string) ([]byte, error)

func (*MongoDB) FindPersonProfile

func (db *MongoDB) FindPersonProfile(ctx context.Context, _id string) ([]byte, error)

func (*MongoDB) Save

func (db *MongoDB) Save(ctx context.Context, person any) (*mongo.InsertOneResult, error)

func (*MongoDB) Update

func (db *MongoDB) Update(ctx context.Context, _id string, person any) (*mongo.UpdateResult, error)

Jump to

Keyboard shortcuts

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