teamongo

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 23 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DatabaseName = "teaweb" // 数据库名
)

Variables

This section is empty.

Functions

func BSONArrayBytes

func BSONArrayBytes(data []byte) (interface{}, error)

func BSONDecode

func BSONDecode(value interface{}) (interface{}, error)

func RestartClient

func RestartClient()

func SharedClient

func SharedClient() *mongo.Client

获取共享的Client

func Test

func Test() error

测试连接

Types

type Collection

type Collection struct {
	*mongo.Collection
}

集合定义

func SharedCollection added in v0.1.7

func SharedCollection(collName string) *Collection

取得共享的集合

func (*Collection) CreateIndex

func (this *Collection) CreateIndex(fields ...*shared.IndexField) error

创建索引

func (*Collection) CreateIndexes added in v0.1.7

func (this *Collection) CreateIndexes(fields ...[]*shared.IndexField) error

创建一组索引

Jump to

Keyboard shortcuts

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