Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blackroot committed Jul 19, 2021
1 parent e980c37 commit d727c89
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions xmongo/official/new_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ func SetUpdateTime(update bson.M) bson.M {
}

type QueryOptions struct {
Skip int64
Limit int64
Sort bson.M
Skip int64
Limit int64
Sort bson.M
//Selector bson.M
}

Expand Down Expand Up @@ -61,14 +61,14 @@ func Limit(limit int64) QueryOpt {
}
}

func Sort(fields ...string) QueryOpt {
func Sort(sort bson.M) QueryOpt {
return func(opts *QueryOptions) {
opts.Sort = append(opts.Sort, fields...)
opts.Sort = sort
}
}

func Select(selector bson.M) QueryOpt {
return func(opts *QueryOptions) {
opts.Selector = selector
}
}
//func Select(selector bson.M) QueryOpt {
// return func(opts *QueryOptions) {
// opts.Selector = selector
// }
//}

0 comments on commit d727c89

Please # to comment.