Associate
- Joined
- 14 Apr 2003
- Posts
- 1,101
Hi,
I have a series of records in MongoDB (although it could be anything for the purpose of this question). Lets say I have a number of products:
Product:
id
name
price
date_added
interestingness
I want to list the 25 most interesting products ordered by date (latest added at the top). I always want to have some products listed so if there aren't any good ones it should choose worse ones. How does this general kind of algorithm work, ideally at a database level.
I have a series of records in MongoDB (although it could be anything for the purpose of this question). Lets say I have a number of products:
Product:
id
name
price
date_added
interestingness
I want to list the 25 most interesting products ordered by date (latest added at the top). I always want to have some products listed so if there aren't any good ones it should choose worse ones. How does this general kind of algorithm work, ideally at a database level.