Post 5.0->6.0 upgrade: BSON field 'changeStreamPreAndPostImages' is an unknown field

I have upgraded a system using mongo from 5.0 to 6.0.
Then, I tried to enable pre/post Images using this command:
db.runCommand({collMod: ‘collName’, changeStreamPreAndPostImages: {enabled: true}})

But I get this error:
MongoServerError: Failed command { collMod: "collName", changeStreamPreAndPostImages: { enabled: true }, writeConcern: { w: "majority", wtimeout: 60000, provenance: "implicitDefault" } } for database 'dbName' on shard 'shard1' :: caused by :: BSON field 'changeStreamPreAndPostImages' is an unknown field.

When checking mongod/mongos versions I see db version v6.0.1
And mongosh version is 1.5.4

On a new installation of my system (with mongo 6.0) this works fine.
Is there anything I am missing with the configuration for this upgrade?


Hello @Oded_Raiches ,

It seems like you missed the last step while upgrading the standalone from version 5.0 to 6.0 according to this documentation. To enable 6.0 features, set the feature compatibility version ( FCV ) to 6.0.

Run the setFeatureCompatibilityVersion command against the admin database:

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

Note: Enabling these backwards-incompatible features can complicate the downgrade process since you must remove any persisted backwards-incompatible features before you downgrade. It is recommended that after upgrading, you allow your deployment to run without enabling these features for a burn-in period to ensure the likelihood of downgrade is minimal. When you are confident that the likelihood of downgrade is minimal, enable these feature=s.



This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.