Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-32953

Log a deprecation warning when the maxScan find option is used.

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 3.7.3
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None
    • Fully Compatible
    • Query 2018-02-26

      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.

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: