Documentation ¶
Index ¶
- Constants
- func BindData(data interface{}, ret interface{}) (err error)
- func GetOneOption() *options.FindOneOptions
- func GetOption() *options.FindOptions
- func NewMongoClient(mongoConf string) *mongo.Client
- func ObjToString(id primitive.ObjectID) string
- func ToBsonD(data interface{}) bson.D
- func ToMap()
- func ToObjectID(id string) primitive.ObjectID
- func WhereOrResult(condition *Condition, secondCondition ...*Condition) bson.M
- type Condition
- type Conf
- type Insert
- type Search
- func (s *Search) GetOneOption() *options.FindOneOptions
- func (s *Search) GetOption() *options.FindOptions
- func (s *Search) SetHint(hint string) *Search
- func (s *Search) SetLimit(limit int64) *Search
- func (s *Search) SetOffset(offset int64) *Search
- func (s *Search) SetSelect(fields string) *Search
- func (s *Search) SetSort(field string, sort SortType) *Search
- type SearchSort
- type SortType
- type Update
Constants ¶
View Source
const ASC = SortType(1)
View Source
const DESC = SortType(-1)
Variables ¶
This section is empty.
Functions ¶
func GetOneOption ¶
func GetOneOption() *options.FindOneOptions
func GetOption ¶
func GetOption() *options.FindOptions
func NewMongoClient ¶
func ObjToString ¶
func ToObjectID ¶
Types ¶
type Condition ¶
type Condition struct {
// contains filtered or unexported fields
}
func NewCondition ¶
func NewCondition() *Condition
type Insert ¶
type Insert struct {
// contains filtered or unexported fields
}
func NewInsertOne ¶
func NewInsertOne() *Insert
type Search ¶
type Search struct { Projection string // 返回字段select Skip int64 Limit int64 Sort bson.D Hint string }
func (*Search) GetOneOption ¶
func (s *Search) GetOneOption() *options.FindOneOptions
func (*Search) GetOption ¶
func (s *Search) GetOption() *options.FindOptions
type SearchSort ¶
Click to show internal directories.
Click to hide internal directories.