mongox

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Init 初始化mongo数据库

func New

func New(key ...string) (*mongo.Collection, error)

New 根据数据库名称,集合名称获取集合操作对象;参数顺序database_name,collection_name;

func RegisterMongoDB

func RegisterMongoDB()

RegisterMongoDB 注册mongodb

Types

type Config

type Config struct {
	Database string `mapstructure:"database"`
	Conn     string `mapstructure:"conn"`
}

Config mongo配置

Jump to

Keyboard shortcuts

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