#Need help connecting mongodb replica set

23 messages · Page 1 of 1 (latest)

pseudo coral
#

Hey i had created a project with mongodb - but seems like it requires a replica set.

So i started fresh created a new project and used the template for creating the replica set.

How do i now connect this replica set to my primary mongodb instance?

quasi lodgeBOT
#

Project ID: 6a1c0558-f3b6-48a5-8e82-0385da7fbc2b

pseudo coral
#

6a1c0558-f3b6-48a5-8e82-0385da7fbc2b

craggy lark
#

the same way you connect to a single instance, just use the first node

pseudo coral
#

i am not able to it doesn't have a public URL

#

and if i try to connect with compass even with direct connection enabled it only gives me read access

craggy lark
#

it does have a public url though

pseudo coral
#

Is it the public networking one ?

#

i generated it

craggy lark
#

the templates comes with a public url

pseudo coral
#

i am not able to find it - i am really sorry acting dumb would really appreciate a bit of handholding here

craggy lark
#

that info icon means its public

pseudo coral
#

it connects but again only read access to it

#

if you see there is not add or + sign in here

craggy lark
#

ill deploy and see what happens

pseudo coral
#

if there's a way maybe we can connect and you can just check on my existing project ?

#

Normally on a mongodb servie there's a "data" tab as well but this one doesn't have it - am i supposed to connect it to a primary node(create another mongodb) ?

pseudo coral
#

@craggy lark i think i found the issue - i wasn't connecting to the primary node it worked now will import data connect to the app and check

#

it worked
Thanks so much for your help ser :))
Really appreciate it

So

  1. Finding the right Primary node
  2. adding ?authSource=admin&replicaSet=rs0&retryWrites=true&w=majority&directConnection=true this to my conection string everything works fine
craggy lark
#

awsome!

craggy lark
#

!s