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

Count command only accepts a string comment but should accept any BSON type in 4.4

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • 4.4.14
    • None
    • None
    • Fully Compatible
    • ALL
    • QE 2022-03-07

    Description

      SERVER-29794 generally implements comment on all commands in 4.4 and is available only if featureCompatibilityVersion is set to 4.4. SERVER-44847 removes the old comment command for count in 5.0.

      I expect

      db.runCommand({count: "documents", comment: true })

      to work on both 4.4 and 5.0.

      However, using this command in 4.4.12 with

      db.adminCommand( { setFeatureCompatibilityVersion: "4.4" } )

      does not accept

      db.runCommand({count: "documents", comment: true })

      and returns the error:

      "errmsg" : "BSON field 'count.comment' is the wrong type 'bool', expected type 'string'",
      

      I suspect in 4.4, the comment command that SERVER-44847 removes is being used instead of SERVER-29794.

      This is inconsistent with our documentation that says the comment can be "any valid BSON type (string, integer, object, array, etc)."

      Attachments

        Issue Links

          Activity

            People

              denis.grebennicov@mongodb.com Denis Grebennicov
              edwin.zhou@mongodb.com Edwin Zhou
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: