In MongoDB,the limit() method is used to limit the result set to be returned. You can also use this with various methods such as sort() and skip() for various combination of requirement.
The MS SQL equivalent is TOP function
>SELECT TOP 10 * FROM <TABLENAME>
Some examples are
Top ‘N’Record
db.categories.find().sort({$natural:1}).limit(10 )
Bottom ‘N’ Record
db.categories.find().sort({$natural:-1}).limit(10 )
Middle Record
db.categories.find().skip(db.categories.count()/2).limit(1)
Range of records from 3 and then select 4 records
>var startRange=3
> var EndRange=4
> db.categories.find().skip(startRange).limit(EndRange)
Output:

Like this:
Like Loading...
About Prashanth Jayaram
DB Technologist, Author, Blogger, Service Delivery Manager at CTS, Automation Expert, Technet WIKI Ninja, MVB and Powershell Geek
My Profile:
https://social.technet.microsoft.com/profile/prashanth jayaram/
http://www.sqlshack.com/author/prashanth/
http://codingsight.com/author/prashanthjayaram/
https://www.red-gate.com/simple-talk/author/prashanthjayaram/
http://www.sqlservercentral.com/blogs/powersql-by-prashanth-jayaram/
Connect Me:
Twitter @prashantjayaram
GMAIL powershellsql@gmail.com
The articles are published in:
http://www.ssas-info.com/analysis-services-articles/
http://db-pub.com/
http://www.sswug.org/sswugresearch/community/