diff --git a/db/db.go b/db/db.go index b014190..b9429c4 100644 --- a/db/db.go +++ b/db/db.go @@ -239,12 +239,12 @@ func GetStat(chatID int64) (map[string]int, error) { } for caloriesCursor.Next(context.Background()) { var result Calories - if err := cursor.Decode(&result); err != nil { + if err := caloriesCursor.Decode(&result); err != nil { log.Fatal(err) } res["Калории"] += result.Count } - if err := cursor.Err(); err != nil { + if err := caloriesCursor.Err(); err != nil { log.Fatal(err) }