As per AWS, Mongo Compass do not support correct NodeJs driver.
Drivers that support Amazon DocumentDB 5.0 and the MONGODB-AWS authentication mechanism should work with the IAM authentication implementation in Amazon DocumentDB. There is a known limitation with NodeJS drivers which are currently not supported by Amazon DocumentDB for IAM authentication. NodeJS driver support will be updated once the limitation is resolved