For AI agents: a documentation index is available at https://www.mongodb.com/docs/llms.txt — markdown versions of all pages are available by appending .md to any URL path.
db.collection.aggregate() (mongosh method)
MongoDB with drivers
This page documents a mongosh method. To see the equivalent method in a MongoDB driver, see the corresponding page for your programming language: