mongo_orm

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBOption

type DBOption func(*DBOptions)

func SetCollection

func SetCollection(collection string) DBOption

func SetContext

func SetContext(ctx context.Context) DBOption

func SetDatabase

func SetDatabase(database string) DBOption

func SetUri

func SetUri(uri string) DBOption

type DBOptions

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

type MgoDB

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

func New

func New(opts ...DBOption) *MgoDB

func (*MgoDB) ConnectDB

func (m *MgoDB) ConnectDB(opt ...*options.ClientOptions) error

func (*MgoDB) DB

func (m *MgoDB) DB() *mongo.Database

func (*MgoDB) Error

func (m *MgoDB) Error() error

func (*MgoDB) Find

func (m *MgoDB) Find(ctx context.Context, filter interface{}, result interface{}) *MgoDB

func (*MgoDB) First

func (m *MgoDB) First(ctx context.Context, filter interface{}, result interface{}) *MgoDB

func (*MgoDB) GetClient

func (m *MgoDB) GetClient() *mongo.Client

func (*MgoDB) Insert added in v0.0.3

func (m *MgoDB) Insert(ctx context.Context, result interface{}, opts ...*options.InsertOneOptions) *MgoDB

func (*MgoDB) Inserts added in v0.0.3

func (m *MgoDB) Inserts(ctx context.Context, result []interface{}, opts ...*options.InsertManyOptions) *MgoDB

func (*MgoDB) SetCollection

func (m *MgoDB) SetCollection(collection string) *MgoDB

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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