Error after adding server api to mongo client settings

Hi, I encountered the following error after updating the driver to the latest version to include version api. Error occurred when I tried to run an update command.

Error: Command update failed: BSON field 'update.apiVersion' is an unknown field..

The code for updating:

Collection.UpdateOneAsync(filter, entityToUpdate, updateOptions, cancellationToken);

The code for connecting to MongoDB is as such:

 var settings = MongoClientSettings.FromConnectionString(
                Configuration.GetSection("section").GetValue<string>("ConnectionString"));
            settings.ServerApi = new ServerApi(ServerApiVersion.V1);
            settings.ReadPreference = ReadPreference.Primary;
            settings.ReplicaSetName = "atlas-vceroi-shard-0";
            settings.ApplicationName = "MongoDB%20Compass";
            settings.UseTls = true;

Commenting out the line settings.ServerApi = new ServerApi(ServerApiVersion.V1), solves the error currently but I would like to be able to add in the versioned api, may I know what could have caused the error and how else to go about it ? Thank you!

Hi @Yuni_Orhnee,

Were you able to find an answer to your question?

If not, please confirm the specific version of the driver you updated to. I assume you are referring to the C#/.NET driver, in which case you need version 2.13.0 or later for Versioned API support.

Regards,
Stennie