mongo --nodb
MongoDB shell version: 2.0.1
> hosts = 'localhost:10001,localhost:10002,localhost:10003'
localhost:10001,localhost:10002,localhost:10003
> conn = new Mongo(hosts)
Thu Nov 10 17:53:24 SyncClusterConnection connecting to [localhost:10001]
Thu Nov 10 17:53:24 SyncClusterConnection connecting to [localhost:10002]
Thu Nov 10 17:53:24 SyncClusterConnection connecting to [localhost:10003]
connection to localhost:10001,localhost:10002,localhost:10003
> db = conn.getDB('admin')
admin
admin[17:53:34]> db.foo.insert(
)
Thu Nov 10 17:53:39 Error: error doing insert:SyncClusterConnection::insert prepare failed: localhost:10001:
localhost:10002:
{ assertion: "unauthorized db:admin lock type:1 client:127.0.0.1", assertionCode: 10057, errmsg: "db assertion failure", ok: 0.0 }localhost:10003:
{ assertion: "unauthorized db:admin lock type:1 client:127.0.0.1", assertionCode: 10057, errmsg: "db assertion failure", ok: 0.0 }shell/collection.js:173
admin[17:53:39]> db.auth('admin','password')
1
admin[17:53:47]> db.foo.insert(
{a:1})
Thu Nov 10 17:53:50 Error: error doing insert:SyncClusterConnection::insert prepare failed: localhost:10002:
localhost:10003:
{ assertion: "unauthorized db:admin lock type:1 client:127.0.0.1", assertionCode: 10057, errmsg: "db assertion failure", ok: 0.0 }shell/collection.js:173
- is depended on by
-
SERVER-4237 Enable the full js test suite to run with authentication enabled
- Closed