func (mq *minQuery) Select(selector interface{}) MinQuery {
	mq.projection = selector
	return mq
}
Select implements MinQuery.Select().
package minquery
import (
	"errors"
	"github.com/globalsign/mgo"
	"github.com/globalsign/mgo/bson"
)
var DefaultCursorCodec cursorCodec
type MinQuery interface {
	Sort(fields ...string) MinQuery
	Select(selector interface{}) MinQuery
	Limit(n int) MinQuery
	Cursor(c string) MinQuery
	CursorCodec(cc CursorCodec) MinQuery
	All(result interface{}, cursorFields ...string) (cursor string, err error)
}
var errTestValue = errors.New("Intentional testing error")
type minQuery struct {
	db   *mgo.Database
	hint map[string]int
	coll string
	filter interface{}
	sort bson.D
	projection interface{}
	limit int
	cursor string
	cursorCodec CursorCodec
	cursorErr error
	min bson.D
	testError bool
}
func New(db *mgo.Database, coll string, query interface{}) MinQuery {
	return NewWithHint(db, coll, query, nil)
}
func NewWithHint(db *mgo.Database, coll string, query interface{}, hint map[string]int) MinQuery {
	return &minQuery{
		db:          db,
		coll:        coll,
		filter:      query,
		hint:        hint,
		cursorCodec: DefaultCursorCodec,
	}
}
func (mq *minQuery) Sort(fields ...string) MinQuery {
	mq.sort = make(bson.D, 0, len(fields))
	for _, field := range fields {
		if field == "" {
			continue
		}
		n := 1
		if field[0] == '+' {
			field = field[1:]
		} else if field[0] == '-' {
			n, field = -1, field[1:]
		}
		mq.sort = append(mq.sort, bson.DocElem{Name: field, Value: n})
	}
	return mq
}