I have noticed that quite a few people have read this question:
Wrongly and assumed it was a duplicate of:
However if you read the two questions you will realise that they are completely different.
I normally wouldn't moan about this but it gives a huge message sending most future viewers to the wrong question giving the wrong answer and the wrong information to solve the problem. Call me OCD but it's cataloged wrongly.
I have cast a re-open vote on the question however I am hoping we could get together and reverse this because clearly the OP was not looking for the
$slice command and wasn't even looking at getting a range of a subdocument from a root document. So the "duplicate" is of a completely different problem. He is actually trying to get a random document from within a collection in a performant manner (and of course
$slice is useless there).