feat: implement mongo APIs
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user