In Spark 3.1.x MongoTable.name can be referenced without a specialized MongoConfig.
Although fixed in Spark 3.2.x - MongoTable should not error when calling name.