slides/mongodb/aggr-op-sort-skip-limit.xml
$sort, $limit, $skip
69/108
Yielding Multiple Documents from One
Order of $sort, $limit, $skip is Important
  • • Sort documents by one or more fields
  • • Same order syntax as cursors
  • • Waits for earlier pipeline operator to return
  • • In-memory unless early and indexed
  • • Limit and skip follow cursor behaviour