dao

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2019 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MONGO_COND_EQUAL         = "$eq"
	MONGO_COND_NOT_EQUAL     = "$ne"
	MONGO_COND_LESS          = "$lt"
	MONGO_COND_LESS_EQUAL    = "$lte"
	MONGO_COND_GREATER       = "$gt"
	MONGO_COND_GREATER_EQUAL = "$gte"
	MONGO_COND_IN            = "$in"
	MONGO_COND_NOT_IN        = "$nin"
	MONGO_COND_REGEX         = "$regex"
	MONGO_COND_OPTIONS       = "$options"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MongoDao

type MongoDao struct {
	*mongo.Client
}

func NewMongoDao

func NewMongoDao(client *mongo.Client) *MongoDao

func (*MongoDao) DeleteById

func (m *MongoDao) DeleteById(tableName string, id interface{}) error

func (*MongoDao) InsertRow

func (m *MongoDao) InsertRow(tableName string, colNames []string, colValues []interface{}) error

func (*MongoDao) InsertRows

func (m *MongoDao) InsertRows(tableName string, colNames []string, colsValues ...[]interface{}) error

func (*MongoDao) SelectAll

func (m *MongoDao) SelectAll(tableName string, query *mongo.Query) ([]bson.M, error)

func (*MongoDao) SelectById

func (m *MongoDao) SelectById(tableName string, id interface{}) (bson.M, error)

func (*MongoDao) SelectByIds

func (m *MongoDao) SelectByIds(tableName string, ids ...interface{}) ([]bson.M, error)

func (*MongoDao) SelectCount

func (m *MongoDao) SelectCount(tableName string, selector interface{}) (int, error)

func (*MongoDao) SelectOne

func (m *MongoDao) SelectOne(tableName string, query *mongo.Query) (bson.M, error)

func (*MongoDao) UpdateById

func (m *MongoDao) UpdateById(tableName string, id interface{}, updater map[string]interface{}) error

type MongoExecResult

type MongoExecResult struct {
	Err error
}

Jump to

Keyboard shortcuts

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