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

Don't store reject: false in query settings

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Query Execution
    • Fully Compatible
    • QE 2024-03-18

      Currently 'reject' is an OptionalBool with three possible values:

      • undefined (not stored)
      • false (stored)
      • true (stored)

      The default value is 'undefined' which also evaluates to 'false'. A user can still specify 'false' explicitly. Logically, we consider that reject setting is default if it is either 'undefined' or 'false'.

      OptionalBool is very convenient for testing, because the settings we retrieve with $querySettings are exact images of the query settings we inserted. It is also convenient for storage, because the default value for reject does not take any space.

      If for some reason we decide not to store 'reject : false', we should prohibit the user to pass it explicitly to 'insert query settings', and also throw on update when the previous value was not 'true'.

      CORRECTION: we should probably allow the user to specify 'reject: false' any time to keep 'setQuerySettings' command 'repeatable'.

            Assignee:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Reporter:
            romans.kasperovics@mongodb.com Romans Kasperovics
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: