I spent so much time going round and round with this error:
2019-12-07T18:59:59.399+0000 E QUERY [thread1] Error: couldn’t add user: there are no users authenticated :
I finally solved it, by
- killing all mongod instances from within the mongo shell with kill all after issuing a ps aux -ef | grep mongod command to confirm PIDs going dark
- I changed my mongod.conf file to port: “27001” a new port from the previous attempts
- I started mongo on port 27001 from the mongo shell (if that makes sense)
- I ussed the db.createUser command AND IT WORKED!