tried with the query like this
mongodb+srv://username:password@hostname/databasename?authSource=admin