Spring writes to local mongodb but not cluster

I am trying to setup a project with spring to use mongodb.
I have previously used nodejs to connect to mongodb and I can see my updates in my cluster but when I try to use spring, I dont see my documents.
If i query the db it returns what I added locally which means data is not replicated to the cluster.
I see this prompt from spring and not sure why it is connecting locally. → “Monitor thread successfully connected to server with description ServerDescription{address=localhost:27017”
Can somebody help with this?
Any pointers or assistance will be appreciated

My URI is defined correclty
spring:
data:
mongodb:
uri : mongodb+srv://username:password@springdb.yo6vwix.mongodb.net/?retryWrites=true&w=majority
database : Tasks

Hello @Enahoro_Oriero ,

Welcome to The MongoDB Community Forums! :wave:

Spring Boot has a feature called “auto configuration”. It could be that the MongoAutoConfiguration is activated with default values, which point to localhost:27017. If you don’t want that behaviour, you can either configure the properties for MongoDB (see Spring Boot Reference Documentation for valid property keys) or disable the MongoAutoConfiguration.

For more information, please refer Connection Guide for Java.

You can also refer below tutorial for setup and configuration

Regards,
Tarun