Lab06-Query Optimization With Indexing
Lab06-Query Optimization With Indexing
2. Make sure you have a local MongoDB instance running (see lab #2) or use the
remote MongoDB Atlas instance (see lab #1).
7. Enable profiling
> db.setProfilingLevel(2)
8. See the execution statistics for the highest closing price in the data set:
> db.values.find({}).sort({close: -1}).limit(1).explain("executionStats")
Notice the "totalDocsExamined" field shows 4308303, which means that all 4 million
documents have been scanned.