lxDb

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetMongoDbConnection

func GetMongoDbConnection(url string) *mgo.Session

NewMongoDbConn, get a new db connection

Types

type ChangeInfo

type ChangeInfo struct {
	Updated int // Number of documents updated
	Removed int // Number of documents removed
	Matched int // Number of documents matched but not necessarily changed
}

ChangeInfo holds details about the outcome of an update operation.

type MongoDb

type MongoDb struct {
	Conn       *mgo.Session
	Name       string
	Collection string
}

Db struct for mongodb

func NewMongoDb

func NewMongoDb(connection *mgo.Session, dbName, collection string) *MongoDb

func (*MongoDb) Setup

func (db *MongoDb) Setup(indexes []mgo.Index) error

Setup create indexes for user collection.

type Options

type Options struct {
	Sort  string `json:"sort,omitempty"`
	Skip  int    `json:"skip"`
	Limit int    `json:"limit"`
	Count bool   `json:"count"`
}

Jump to

Keyboard shortcuts

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