How to see your compatibility set?

I know you can set the compatibility with

db.adminCommand( { setFeatureCompatibilityVersion: “4.0” } )

But how do you see your current compatibility?

Hi @Doug_Whitfield

Thanks, I had assumed there would be a “get” to follow the “set”. Is the common Mongo syntax for set commands to just drop the set and run a getParameter? That seems unnecessarily complicated. What are the two 1s in the example for?

Hi @Doug_Whitfield,

It is more typical for parameters to use getParameter/setParameter. However, the setFeatureCompatibilityVersion command is more complex than just setting a parameter value and is also run rarely (usually as the final step in a major version upgrade).

The values in this example are just placeholders to create a valid JSON document:

db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } )

Per the getParameter documentation:

  • getParameter field: use any numerical value to return the value for the specified <parameter>
  • <parameter> field: string name of the parameter to retrieve. The value does not affect output.

So an equivalent command invocation would be:

 db.adminCommand( { getParameter: 0, featureCompatibilityVersion: '' } )

Regards,
Stennie

1 Like