SQL Server has a handy operator called "TOP N WITH TIES", which returns
two or more rows that tie for last place in the limited results set
For example, TOP 3 WITH TIES
from {10, 9, 8, 8, 2} will return {10, 9, 8, 8}.
Is there a single-query equivalent for TOP N WITH TIES
for MongoDB?
I can't use two queries (with the second searching for the minimum value returned by the first) because I'm running the query in a Meteor publish function, which doesn't let you return more than one cursor from the same collection.