Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-12377

Document return value of db.setProfilingLevel()

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Fixed
    • None
    • None
    • manual

    Description

      Description

      https://docs.mongodb.com/manual/reference/method/db.setProfilingLevel/ does not specify what the return value is.

      I tried:

      ruby-driver-rs:PRIMARY> db.setProfilingLevel(2,-1)
      {
      	"was" : 1,
      	"slowms" : 0,
      	"sampleRate" : 1,
      	"ok" : 1,
      	"$clusterTime" : {
      		"clusterTime" : Timestamp(1547760253, 1),
      		"signature" : {
      			"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
      			"keyId" : NumberLong(0)
      		}
      	},
      	"operationTime" : Timestamp(1547760253, 1)
      }
      

      `was:1` makes sense, but `slowms:0` not so much. It appears to be the old value of slowms, but the key name does not indicate that the value returned is the old value.

      Scope of changes

      At minimum, document that setProfilingLevel returns the previous value of anything modified in the command/method.

       

      Attachments

        Activity

          People

            kay.kim@mongodb.com Kay Kim (Inactive)
            oleg.pudeyev@mongodb.com Oleg Pudeyev
            Kay Kim Kay Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              2 years, 34 weeks, 3 days ago