Getting Started with Private MongoDB Server

After your Private MongoDB Server has been ordered and provisioned, you can start creating databases through the Everleap Control Panel. Please note that you will not be able to create databases through the mongo shell. “dbOwner” rights are automatically granted to your primary database login for each database you create through our Control Panel.
 
 
Creating the Database
  1. Log in to the Private MongoDB section of Control Panel.
  2. Enter the database name and click on the Create Database button.
 
 
Deleting the Database
  1. Log in to the Private MongoDB section of Control Panel.
  2. Click on the Delete link next to the database.
 
 
Changing the Primary Database Login Password
  1. Log in to the Private MongoDB section of Control Panel.
  2. Click on Change Password link.
  3. Enter your new password and click on the Update Password button.
 
 
MongoDB Connection String
 
Your MongoDB Connection string for use in your application has the following format:
mongodb://username:password@server_name.everleap.com:27017/database_name
where username, password, server_name, and database_name are values you supply.  You can find the server and database names in the Control Panel.
 
The following instructions presuppose that you have the MongoDB binaries installed somewhere on your local machine.  If you don’t have them, you can get them here.
 
 
 
Connecting to the Server via the Mongo Shell
 
At the command prompt, type in:
mongo.exe --host server_name.everleap.com/database_name --port 27017 -u username -p password --authenticationDatabase admin
where server_name, database_name, username and password are values you supply.  Please note that “/database_name” is optional.
 
 
 
Backing Up Your MongoDB Database
 
At the command prompt, type in:
mongodump.exe /host:server_name /port:27017 /authenticationDatabase:admin /user:username /password:password /db:database_name /out:file_directory_path
where server_name, database_name, username and password are values you supply.  The file_directory_path is a local path on your machine.
 
 
 
Restoring Your MongoDB Database
 
At the command prompt, type in:
mongorestore.exe /host:server_name /port:27017 /authenticationDatabase:admin /user:username /password:password /drop /db:database_name file_directory_path
where server_name, database_name, username and password are values you supply.  The file_directory_path is a local path on your machine where the backup resides.
 
 
 
Creating Additional Users
 
Follow the instructions above to connect to your server via the mongo shell with your primary database user login, then type in:
use database_name
db.createUser({ “user” : “username”, “pwd” : “password”, “roles” : [ { “role” : “role”, “db” : “database_name” } ] })
where username, password, role, and database_name are values you supply.  Valid roles include read, readWrite, dbAdmin, dbOwner, userAdmin, and any custom defined roles.  For more information, please see this link.