mongodb

package
v0.0.0-...-66588ff Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Database *mongo.Database
)

Functions

func InsertUserAsyncMongoDB

func InsertUserAsyncMongoDB(
	ctx context.Context,
	user User,
	chanUser chan ChanUser,
)

func NewMongoDBConnection

func NewMongoDBConnection(
	ctx context.Context,
) error

Types

type ChanUser

type ChanUser struct {
	Err  error
	User *User
}

type User

type User struct {
	ID   primitive.ObjectID `bson:"_id,omitempty"`
	Name string             `bson:"name"`
	Age  int64              `bson:"age"`
}

func InsertUserSyncMongoDB

func InsertUserSyncMongoDB(
	ctx context.Context,
	user User,
) (*User, error)

Jump to

Keyboard shortcuts

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