Articles → MONGODB → $Limit And $Skip Aggregation Stages In Mongodb

$Limit And $Skip Aggregation Stages In Mongodb






Purpose







Example




Picture showing the sample document collection




db.orders.aggregate([
  {
    $limit: 2
  }
])


Picture showing the output of $limit aggregation operator in mongodb




db.orders.aggregate([
  {
    $skip: 2
  }
])


Picture showing the output of $skip aggregation operator in mongodb





Posted By  -  Karan Gupta
 
Posted On  -  Monday, June 10, 2024

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250