I have MongoDB up and running - I am able to sign into my VPS via SSH and execute the mongo
command.
Here is where I run into a problem. Here are some test commands and their output:
[*******]$ mongo
MongoDB shell version: 1.4.4
url: test
connecting to: test
type "help" for help
> db
test
> db.test.save({a:1});
unauthorized
Here is another example of test input and its output:
[*******]$ mongo
MongoDB shell version: 1.4.4
url: test
connecting to: test
type "help" for help
> use admin
switched to db admin
> db.addUser( { user: "drew", pwd: "myPassword", roles: [ "userAdminAnyDatabase" ] } )
Thu Apr 25 16:34:37 JS Error: uncaught exception: error {
"$err" : "unauthorized db:admin lock type:-1 client:127.0.0.1",
"code" : 10057
}
unauthorized db:admin lock type:-1 client:127.0.0.1
So I'm a bit stuck - I don't know if this will help or not, but here is some sample code and output when using the PHP class as well:
Script
<?php
$dbHost = $dbHost = 'mongodb://*******.dreamhostps.com';;
$m = new Mongo($dbHost);
var_dump($m);
?>
Output
object(Mongo)#2 (4) { ["connected"]=> bool(true) ["status"]=> NULL ["server":protected]=> string(33) "mongodb://ps93785.dreamhostps.com" ["persistent":protected]=> NULL }
Other Notes
Server location was redacted - I am not actually using asterisks.
Update - output from fsyncUnlock()
[*******]$ mongo
MongoDB shell version: 1.4.4
url: test
connecting to: test
type "help" for help
> db.fsyncUnlock()
Thu Apr 25 17:36:40 JS Error: TypeError: db.fsyncUnlock is not a function (shell):0