mongo

package
v0.0.0-...-b8c6fc2 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Close

func Close() error

*

  • 关闭会话

func Dial

func Dial(url, database string, sessionNum int) (err error)

*

  • 开启会话
  • uri: [mongodb://][user:pass@]host1[:port1][,host2[:port2],...][/database][?options]

func Do

func Do(collection string, do func(c *mgo.Collection) error) error

**

  • 执行操作

func NewRepository

func NewRepository(seed MongoModal) *mongoRepository

create

Types

type Data

type Data interface {
	ID() bson.ObjectId
}

type MongoModal

type MongoModal interface {
	MongoID() interface{}
	SetObjectId(id bson.ObjectId)
	MongoCollection() string
}

Jump to

Keyboard shortcuts

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