cayasso / mongo-oplog

Watch mongodb oplog in a simple way
380 stars 91 forks source link

how can I connect to remote server with an auth? #60

Closed xuxiaoyuspallow closed 6 years ago

xuxiaoyuspallow commented 6 years ago

Assume that the auth of admin database is("user","pwd"),and when I connected the server using the url mongodb://user:pwd@ip:port/local,it would't work.How can i fix it?

xuxiaoyuspallow commented 6 years ago

well, i fix this by adding the authSource to url: mongodb://user:pwd@ip:port/local?authSource=admin