Getting error when i run the below commond

Hi team i getting below error when i run this(mongo mongodb+srv://myuser:mypassword@mflix-xdkcq.mongodb.net/test?retryWrites=true&w=majority) in commond line
Error:
MongoDB server version: 4.0.13
Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.]
MongoDB Enterprise mflix-shard-0:PRIMARY>

It is just a warning which says user does not have privs on admin DB
You are already connected to mongodb
Please ignore those messages and continue with your work

Thank you Ramachandra! I am able to continue my work, but just wanted to know how to resolve this warning?

Two ways:

  1. Give the user the getLog action permission on the admin db
    – Pros: resolves the error and user will be able to see the startupWarnings
    – Cons: the user may be able to retrieve more logs than intended, e.g. db.adminCommand({ getLog: "global"})
  2. Use the –quiet option in mongo
    – Pros: suppresses all outputs during startup
    – Cons: is this a good thing?
1 Like