Add sort to find
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"go.mongodb.org/mongo-driver/v2/mongo"
|
||||
)
|
||||
|
||||
func BuildPaginationPipeline(skip, limit int64, filter bson.M, sort bson.M) mongo.Pipeline {
|
||||
func BuildPaginationPipeline(skip, limit int64, filter bson.M, sort bson.D) mongo.Pipeline {
|
||||
pipe := mongo.Pipeline{
|
||||
// 1. GLOBAL FILTER: Always filter first to use indexes
|
||||
{{Key: "$match", Value: filter}},
|
||||
|
||||
Reference in New Issue
Block a user