def _update_fc_version(client: pymongo.MongoClient):
    """Updates a database's feature compatibility version (FCV) if possible.

    Checks to see if a version upgrade for the FCV is required and possible.
    If it is, issue an upgrade and log as a warning.

    Note that MongoDB will fail to initialize if the server version and FCV
    differ by two or more major versions, so this check may be redundant.

    Args:
        client: a ``pymongo.MongoClient`` to connect to the database
    """

    global _db_service

    fc_version, server_version = _get_fcv_and_version_if_allowed(client)

    if fc_version is None:
        return

    if (
        _is_fcv_upgradeable(fc_version, server_version)
        and _db_service is not None
    ):
        bumped = f"{server_version.major}.0"
        cmd = {"setFeatureCompatibilityVersion": bumped}

        if (
            server_version.major
            >= foc.MONGODB_SERVER_FCV_REQUIRED_CONFIRMATION.major
        ):
            # Server version 7.0+ added the confirm flag
            cmd["confirm"] = True

        try:
            logger.warning(
                "Your MongoDB server version is newer than your feature "
                "compatibility version. "
                "Upgrading the feature compatibility version now. "
                "You can suppress this exception by setting your "
                "`database_validation` config parameter to `False`. See "
                "https://docs.voxel51.com/user_guide/config.html#configuring-a-mongodb-connection "
                "for more information"
            )
            client.admin.command(cmd)

        except OperationFailure as e:
            logger.error(
                "Operation failed while updating database's feature "
                "compatibility version - %s. "
                "Please manually set it to %s. "
                "You can suppress this exception by setting your "
                "`database_validation` config parameter to `False`. See "
                "https://docs.voxel51.com/user_guide/config.html#configuring-a-mongodb-connection "
                "for more information" % (str(e), bumped)
            )

        except PyMongoError as e:
            logger.error(
                "MongoDB error while updating database's feature "
                "compatibility version - %s. "
                "Please manually set it to %s. "
                "You can suppress this exception by setting your "
                "`database_validation` config parameter to `False`. See "
                "https://docs.voxel51.com/user_guide/config.html#configuring-a-mongodb-connection "
                "for more information" % (str(e), bumped)
            )
Updates a database's feature compatibility version (FCV) if possible.

    Checks to see if a version upgrade for the FCV is required and possible.
    If it is, issue an upgrade and log as a warning.

    Note that MongoDB will fail to initialize if the server version and FCV
    differ by two or more major versions, so this check may be redundant.

    Args:
        client: a ``pymongo.MongoClient`` to connect to the database
    
fiftyone/core/odm/database.py