Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1211

BSON field 'profile.sampleRate' is the wrong type 'int', expected type 'double'

    XMLWordPrintable

Details

    • Bug
    • Status: Needs Triage
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • None
    • None
    • MacOS
      Mongosh v1.3.1
      MongoDB v4.0 & v4.4

    Description

      Problem Statement/Rationale


      Mongosh cannot process the commands below

      test> db.setProfilingLevel(0, { slowms: 100, sampleRate: 1})
      MongoServerError: BSON field 'profile.sampleRate' is the wrong type 'int', expected type 'double'
       
      test> db.setProfilingLevel(0, { slowms: 100, sampleRate: 1.0})
      MongoServerError: BSON field 'profile.sampleRate' is the wrong type 'int', expected type 'double'
      

      Steps to Reproduce

      Run the command

      test> db.setProfilingLevel(0, { slowms: 100, sampleRate: 1})

      Expected Results


      db.setProfilingLevel(0, { slowms: 100, sampleRate: 1})
      { was: 0, slowms: 100, sampleRate: 1, ok: 1 }
      

      Actual Results


      test> db.setProfilingLevel(0, { slowms: 100, sampleRate: 1})
      MongoServerError: BSON field 'profile.sampleRate' is the wrong type 'int', expected type 'double'
      

      Additional Notes

      It works if I convert 1 or 1.0 to double using Double()

      test> db.setProfilingLevel(0, { slowms: 100, sampleRate: Double(1)})
      { was: 0, slowms: 100, sampleRate: 1, ok: 1 }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              raymond.hu@mongodb.com Raymond Hu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: