Getting Trending Items from FireStore
I am trying to use firestore and get a top list of items saved into the database. I want for example the top newest, top most worn, and top trending.
An item in the datastore looks something like this. The issue is that for trending items I need a formula to calculate the top items (see below). Any idea how to do this?
gravity = 0.2
ranking = amountWorn / (daysSincePost * gravity)
{
ItemId: 1234567890,
AddDate: 01/01/2025,
AmountWorn: 0
}