Replica Set with different storage size

Hi! Thanks for someone who can help me, I have an M30 tier and in the primary replica set I have just 100gb after deleting and compacting the database, however, the secondary replica set still has 190gb and I was reading documentation about using the command of mongo --host clustername.host but it’s not possible to have access, Is there any way that the secondary storage has the same size as the principal one?

Good afternoon, welcome to the MongoDB community.

If you have deleted documents, for example, and want to reduce the size of your disk, you need to connect to each node in your replicaset and run compact, after which you can reduce the size of your cluster’s disk. You can resolve your cluster’s DNS to receive the nodes’ IP and connect. I have a script that does this automatically, follow the DNS resolution part

def resolveDNS(url):
    import dns.resolver
    domain = url

    try:
        answers = dns.resolver.resolve(f"_mongodb._tcp.{domain}", "SRV")
    except dns.resolver.NoAnswer:
        logging.exception("No SRV record found")
        exit()
    except dns.resolver.NXDOMAIN:
        logging.exception(f"Domain {domain} does not exist")
        exit()

    return [str(cluster.target).rstrip(".") for cluster in answers]

and the conn string

connectionString = f"mongodb://{username}:{password}@{cluster}:27017/{database}?authSource=admin&directConnection=true&retryReads=true"

That’s a way ;D

I’m available if needed.