There is a distinct command, however I'm not sure what you need. Distinct is a kind of query command, and with a large number of users, you probably want to collapse data in real time.
Map-Reduce is probably one way to go here.
Card Phase: Your key will be just an identifier. Your value will look like {current_status:'blah',date:1234} .
Reduce phase: Given an array of values, you would capture the most recent and return only it.
To make this work optimal, you probably want to take a look at the new feature from 1.8.0. Reduce / Reduce function. Allows you to process only new data instead of reprocessing the entire collection of statuses.
Another way to do this is to create the “most recent” collection and link the status insert to this collection. Therefore, when you insert a new status for the user, you update his "most recent".
Depending on the importance of this feature, you could do both things.
source share