You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now GET / and GET /api/user return three counters that include:
current user's number of tomatoes completed today
current user's number of tomatoes completed this week
current user's number of tomatoes completed this month
These numbers are computed dynamically running a count query on a subset of tomatoes. The method to count current user's tomatoes completed within a period of time is defined as:
where time_period is included in [:day, :week, :month].
Alternatively we could just rely on score collections to retrieve cached counters. This method would run a query against one of the collections, for instance DailyScore, to find the user's score. The number of queries would be the same, but queries against *Scorecollections would be slightly faster and would alleviate load on the tomatoes collection.
The text was updated successfully, but these errors were encountered:
Right now
GET /
andGET /api/user
return three counters that include:These numbers are computed dynamically running a count query on a subset of tomatoes. The method to count current user's tomatoes completed within a period of time is defined as:
where
time_period
is included in[:day, :week, :month]
.Alternatively we could just rely on score collections to retrieve cached counters. This method would run a query against one of the collections, for instance
DailyScore
, to find the user's score. The number of queries would be the same, but queries against*Score
collections would be slightly faster and would alleviate load on thetomatoes
collection.The text was updated successfully, but these errors were encountered: