Add sort to find

This commit is contained in:
George Suntres
2026-04-25 12:42:30 -04:00
parent 7c60f4c57b
commit 374b4b22c9
6 changed files with 27 additions and 13 deletions

View File

@@ -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}},