mgox

package module
v0.0.0-...-ed65177 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2016 License: BSD-2-Clause Imports: 13 Imported by: 0

README

mgox

mgox is a friendly wapper of mgo.

Installation

go get github.com/yaosxi/mgox

Features

  • Insert
  • Remove
  • Set/Inc/Push/Pull/Replace
  • Find
  • Get

Example

Please refer to dao_test.go

LICENSE

mgox is made available under the Simplified BSD License.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBConfig dbconfig
View Source
var PAGE_RECORD_COUNT = 20

Functions

func Dao

func Dao(configs ...interface{}) *dao

func GetDatabase

func GetDatabase() (*mgo.Database, error)

func GetValueLen

func GetValueLen(v interface{}) int

func IsSlice

func IsSlice(v interface{}) bool

Types

type Page

type Page struct {
	//	Request int `json:"request"`
	Cursor int `json:"cursor"`
	Count  int `json:"count"`
	Total  int `json:"total"`
	Next   int `json:"next"`
}

type PropertyReader

type PropertyReader struct {
	// contains filtered or unexported fields
}

func (PropertyReader) Read

func (c PropertyReader) Read(key string) string

type Query

type Query struct {
	// contains filtered or unexported fields
}

func (*Query) Count

func (q *Query) Count(collectionName interface{}) (int, error)

func (*Query) Distinct

func (q *Query) Distinct(collectionName interface{}, distinct string, result interface{}) error

func (*Query) Exist

func (q *Query) Exist(collectionName interface{}) (bool, error)

func (*Query) First

func (q *Query) First(result interface{}) error

func (*Query) IgnoreNFE

func (q *Query) IgnoreNFE() *Query

func (*Query) Last

func (q *Query) Last(result interface{}) error

func (*Query) Page

func (q *Query) Page(page *Page) *Query

func (*Query) Result

func (q *Query) Result(result interface{}) error

func (*Query) Sort

func (q *Query) Sort(sorts ...string) *Query

Jump to

Keyboard shortcuts

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