From the course: MongoDB Essential Training

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Performance

Performance

- [Instructor] Aggregation pipelines are super powerful, but they also require more RAM and CPU than CRUD operations. So you'll want to keep an eye on performance issues with them, especially if the amount of data you are processing is large, the operation will be run frequently or the operation is intended to provide real time data fast. Luckily, MongoDB allows you to see information about how aggregation pipelines and other queries perform fairly easily. Let's look at it on the terminal. All right, so I have prepared a query here that we are going to use to see some performance information from MongoDB. In the first line here, you can see we are using the movies connection, and then we are calling the explain method and we are passing it a string that says executionStats. That will tell MongoDB that we are not actually interested in the results of the aggregation pipeline that we want to execute here,…

Contents