(Unauthorized) not authorized on admin to execute command

As already noted here you can avoid this by connecting to a database other than the admin one.

To create a new database if none exist, follow this handy guide.Note the database name.

Now, back to your connection uri string, specify that you want to connect to this database specifically. The string should look something like this:

mongodb+srv://<user>:<db-password>@<cluster-name>.d2ylz.mongodb.net/<db-name>

Substitute db-name`` for your actual database name. (You should also already have substituted for user and database password etc.)

This was tested with mongoose > 7.0