parent
f859828370
commit
0b798fe818
@ -1,20 +1,20 @@ |
|||||||
package query |
package query |
||||||
|
|
||||||
import ( |
import ( |
||||||
"go.mongodb.org/mongo-driver/bson" |
"go.mongodb.org/mongo-driver/bson/primitive" |
||||||
) |
) |
||||||
|
|
||||||
// Sorter is a filter to sort the data before query
|
// Sorter is a filter to sort the data before query
|
||||||
type Sorter interface { |
type Sorter interface { |
||||||
Sort() (sort bson.M) |
Sort() (sort primitive.M) |
||||||
} |
} |
||||||
|
|
||||||
// Sort is a simple implementations of the Sorter filter
|
// Sort is a simple implementations of the Sorter filter
|
||||||
type Sort bson.M |
type Sort primitive.M |
||||||
|
|
||||||
var _ Sorter = &Sort{} |
var _ Sorter = &Sort{} |
||||||
|
|
||||||
// Sort returns a slice of fields which have to be sorted
|
// Sort returns a slice of fields which have to be sorted
|
||||||
func (f Sort) Sort() (sort bson.M) { |
func (f Sort) Sort() (sort primitive.M) { |
||||||
return bson.M(f) |
return primitive.M(f) |
||||||
} |
} |
||||||
|
@ -1,20 +1,20 @@ |
|||||||
package query |
package query |
||||||
|
|
||||||
import ( |
import ( |
||||||
"go.mongodb.org/mongo-driver/bson" |
"go.mongodb.org/mongo-driver/bson/primitive" |
||||||
) |
) |
||||||
|
|
||||||
// Updater is a filter to update the data
|
// Updater is a filter to update the data
|
||||||
type Updater interface { |
type Updater interface { |
||||||
Update() (update bson.A) |
Update() (update primitive.A) |
||||||
} |
} |
||||||
|
|
||||||
// Update is a simple implementations of the Updater filter
|
// Update is a simple implementations of the Updater filter
|
||||||
type Update bson.M |
type Update primitive.M |
||||||
|
|
||||||
var _ Updater = &Update{} |
var _ Updater = &Update{} |
||||||
|
|
||||||
// Update returns an update command
|
// Update returns an update command
|
||||||
func (u Update) Update() (update bson.A) { |
func (u Update) Update() (update primitive.A) { |
||||||
return bson.A{bson.M(u)} |
return primitive.A{primitive.M(u)} |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue