However, in a production environment, the server and development machine are generally not the same machine.
At this time, you need to create a database user to enable permission to access from the network.
Please see example:
use test //Switch to the test database //Create a tony user, the password is password1, and the permission is readWrite db.createUser( { user: "tony", pwd: "password1", roles: [ { role: "readWrite", db: "test" } ]})
If you want to see what other permissions are available, use the following:
use test show roles
In this way, the database can be accessed from the network through coding.