How can I limit the number of results when using group() in MongoDB? Basically I'm looking for the equivalent of this MySQL query:
SELECT * FROM items GROUP BY type LIMIT 5;
Edit: I just realized this can be done with Map/Reduce, but I read that using Map/Reduce on a single server (my case) is a bit overkill. Is it true? Ultimately, what's the best way to achieve what I need?