The maxScan option is intended to guard against runaway queries or unexpected bad query plans by limiting the number of keys that the IXSCAN query execution stage is willing to examine. However, this option has since been superseded by maxTimeMS. The maxTimeMS mechanism is more complete in that it applies to most commands, whereas maxScan is only available for find. Furthermore, maxScan can be easily be confused with limit. Limit is a logical component of the query language, whereas maxScan is better understood as a command directive in the vein of maxTimeMS, readConcern, writeConcern, readPreference, and so on.
When maxScan is used, we should occasionally log the following message:
Support for the maxScan option has been deprecated. Instead, use maxTimeMS. See http://dochub.mongodb.org/core/4.0-deprecate-maxScan.