Skip to main content
added 416 characters in body
Source Link
jordibenck
  • 185
  • 1
  • 4
  • 15

I have a mLab mongo database and a nodejs server set up. However, when I try to push something to the database it gives me the following error:

not authorized on DATABASE to execute command { insert: "users", documents: [ { _id: ObjectId('RANDOMID'), username: "USERNAME", email: "EMAIL", 1.0: 0 } ], ordered: true }"

I am the only user and I have the dbOwner role.

package.json:

{
  "name": "api",
  "version": "1.0.0",
  "private": true,
  "main": "app.js",
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "express": "^4.16.3",
    "mocha": "^5.1.1",
    "mongodb": "^3.1.0-beta4",
    "mongoose": "^5.0.11",
    "pug": "^2.0.3",
    "underscore": "^1.8.3"
  }
}

I have a mLab mongo database and a nodejs server set up. However, when I try to push something to the database it gives me the following error:

not authorized on DATABASE to execute command { insert: "users", documents: [ { _id: ObjectId('RANDOMID'), username: "USERNAME", email: "EMAIL", 1.0: 0 } ], ordered: true }"

I am the only user and I have the dbOwner role.

I have a mLab mongo database and a nodejs server set up. However, when I try to push something to the database it gives me the following error:

not authorized on DATABASE to execute command { insert: "users", documents: [ { _id: ObjectId('RANDOMID'), username: "USERNAME", email: "EMAIL", 1.0: 0 } ], ordered: true }"

I am the only user and I have the dbOwner role.

package.json:

{
  "name": "api",
  "version": "1.0.0",
  "private": true,
  "main": "app.js",
  "scripts": {
    "start": "node app.js"
  },
  "dependencies": {
    "express": "^4.16.3",
    "mocha": "^5.1.1",
    "mongodb": "^3.1.0-beta4",
    "mongoose": "^5.0.11",
    "pug": "^2.0.3",
    "underscore": "^1.8.3"
  }
}
Source Link
jordibenck
  • 185
  • 1
  • 4
  • 15

MongoDB cannot authenticate code 18

I have a mLab mongo database and a nodejs server set up. However, when I try to push something to the database it gives me the following error:

not authorized on DATABASE to execute command { insert: "users", documents: [ { _id: ObjectId('RANDOMID'), username: "USERNAME", email: "EMAIL", 1.0: 0 } ], ordered: true }"

I am the only user and I have the dbOwner role.