mmongo

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoNewDriver

type MongoNewDriver struct {
	Host        string
	Timeout     time.Duration
	PoolLimit   int
	DbName      string // 数据库名称
	CollectName string
	URI         string
	Connected   bool // 连接状态
	// contains filtered or unexported fields
}

func NewClient

func NewClient(uri string, dbname string, collectName string) *MongoNewDriver

func (*MongoNewDriver) Connect

func (s *MongoNewDriver) Connect() (err error)

func (*MongoNewDriver) Count

func (s *MongoNewDriver) Count(key string) (count int64, err error)

func (*MongoNewDriver) DeleteOne

func (s *MongoNewDriver) DeleteOne(key string) error

func (*MongoNewDriver) FindAll

func (s *MongoNewDriver) FindAll(prefix string, out interface{}) (err error)

func (*MongoNewDriver) FindOne

func (s *MongoNewDriver) FindOne(key string, out interface{}) (err error)

func (*MongoNewDriver) Insert

func (s *MongoNewDriver) Insert(key string, doc interface{}) (err error)

func (*MongoNewDriver) UpdateOne

func (s *MongoNewDriver) UpdateOne(key string, doc interface{}) (err error)

Jump to

Keyboard shortcuts

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