As @Frederick said requires mongo 2.6 at least, For further reference, here is the link from mongo documentation, which works similar to runCommand way but with db.collection.aggreagate, note that for document limit use "cursor" option, for sort limit use "allowDiskUse" option.