$limit
This aggregation stage limits the number of documents passed to the next stage.
In this example, we are using the "sample_mflix" database loaded from our sample data in the Intro to Aggregations section.
db.movies.aggregate([ { $limit: 1 } ])
Try it Yourself »
This will return the 1 movie from the collection.
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!