Is there any way to efficiently perform the equivalent of DENSE_RANK in MongoDB?
MongoDB doesn't have any concept of ranking.  The closest I could find comes from here:

Here's some sample data:
 &gt; db.scoreboard.find()`
 { &quot;_id&quot; : ObjectId(&quot;4d99f71450f0ae2165669ea9&quot;), &quot;user&quot; : &quot;dave&quot;, &quot;score&quot; : 4 }
 { &quot;_id&quot; : ObjectId(&quot;4d99f71b50f0ae2165669eaa&quot;), &quot;user&quot; : &quot;steve&quot;, &quot;score&quot; : 5 }`
 { &quot;_id&quot; : ObjectId(&quot;4d99f72350f0ae2165669eab&quot;), &quot;user&quot; : &quot;tom&quot;, &quot;score&quot; : 3 }

First, find the score of the user &quot;dave&quot;:
 db.scoreboard.find({ user : &quot;dave&quot; }, { score : 1 }) { &quot;_id&quot; : ObjectId(&quot;4d99f71450f0ae2165669ea9&quot;), &quot;score&quot; : 4 }

Then, count how many users have a higher score:
 db.scoreboard.find({ score : { $gt : 4 }}).count() 
 1

Since there is 1 higher score, dave's rank is 2 (just add 1 to the
count of higher scores to get the rank).

Obviously, this is far from ideal.  However, MongoDB simply does not have any type of functionality for this since it's simply not designed for this type of querying.