feat: implement mongo APIs

This commit is contained in:
Krispire Admin
2026-05-10 00:42:06 +05:30
parent b055b8ba0c
commit 3f09ea1fe5
4 changed files with 19 additions and 10 deletions
+1 -1
View File
@@ -37,7 +37,7 @@ type EssaySummaryDoc struct {
func (r *EssayRepo) GetAll(ctx context.Context) ([]EssaySummaryDoc, error) {
opts := options.Find().
SetSort(bson.M{"group": 1, "order": 1}).
SetSort(bson.D{{Key: "group", Value: 1}, {Key: "order", Value: 1}}).
SetProjection(bson.M{"slug": 1, "title": 1, "year": 1, "group": 1})
cursor, err := r.col.Find(ctx, bson.M{}, opts)
if err != nil {