MongoDB and Robo 3T - Error "Can't output mapReduce results to internal DB admin" / "Location31321" - TagMerge
2MongoDB and Robo 3T - Error "Can't output mapReduce results to internal DB admin" / "Location31321"MongoDB and Robo 3T - Error "Can't output mapReduce results to internal DB admin" / "Location31321"

MongoDB and Robo 3T - Error "Can't output mapReduce results to internal DB admin" / "Location31321"

Asked 1 years ago
1
2 answers

I had the same error. Instead of doing "use admin" I switched to a database with another name and it worked for me.

with "use admin" :

> db.Eleves.mapReduce(map, reduce, {out : "total_masculin"});
Error: map reduce failed:{
        "ok" : 0,
        "errmsg" : "Can't output mapReduce results to internal DB admin",
        "code" : 31321,
        "codeName" : "Location31321"
} :
_getErrorWithCode@src/mongo/shell/utils.js:25:13
DBCollection.prototype.mapReduce@src/mongo/shell/collection.js:1093:15
@(shell):1:1

Switching db :

> use labo1
switched to db labo1

and after recreating my collection in this db :

> db.Eleves.mapReduce(map, reduce, {out : "total_masculin"});
{ "result" : "total_masculin", "ok" : 1 }

Source: link

0

On Ubuntu server, to open mongo shell run:
$ mongo
Inside mongo shell, type following command to create new a admin user.
> use admin;
> db.createUser({user:"admin", pwd:"password", roles:[{ role: "root", db: "admin" }]});
By default mongodb is configured to allow connections only from localhost(IP 127.0.0.1). We need to allow remote connections from any ip address. The following change should only be done in your development server. Open up etc/mongod.conf file and do the following change.
# network interfaces
	net:
	    port: 27017
	    bindIp: 0.0.0.0   #default value is 127.0.0.1
Also in the same mongod.conf file uncomment security option and add authorization option as shown below.
security:
 	  authorization: enabled
Save and exit the mongod.conf file and restart mongodb server.
$ sudo servcie mongod restart

Source: link

Recent Questions on mongodb

    Programming Languages