Skip to content

Port # is used when srv is true #23

@Daxcor69

Description

@Daxcor69

When SRV = true, the port designation should be disabled. If I leave port out of the config I get 27017, if I put undefined it puts the colon and no port number. If I put false then it puts :false.

Here is my options config:

{
  host: 'cluster0.sdfddqmlkssffdsdsn.mongodb.net',
  replicaSetName: 'atlas-7ksdwebssdddhrhalbt-shard-0',
  srv: true,
  username: 'blah',
  password: 'blah',
  outDir: '/backup/2023-2-8-18-23-33',
  authenticationDatabase: 'found',
  authenticationMechanism: 'SCRAM-SHA-1',
  ssl: true,
  sslAllowInvalidCertificates: true,
  all: true
}

Here is the error:

 uri: 'mongodb+srv://blah:blah@cluster0.kysfkiehfkdikdkdkdkfnkhzn.mongodb.net:27017/?authSource=found&authMechanism=SCRAM-SHA-1',
    options: {
      replicaSet: 'atlas-7kadfkjfsjfsueyuhgmbvkfhgidydoswlgulbt-shard-0',
      ssl: true,
      tlsAllowInvalidCertificates: true
    },
    triggerError: MongoParseError: mongodb+srv URI cannot have port number

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions