• database
  • nosql

MongoDB Official documentation

Commands

devops mongodb start
Start MongoDB if stopped
devops mongodb stop
Stop MongoDB if started
devops mongodb reload
Reload MongoDB, reload the configuration and perform a graceful restart
devops mongodb restart
Restart MongoDB, reload the configuration (but kills existing connection)
devops mongodb user add
Adds a MongoDB database admin user.

Options

Name Type Description Required
databases array Array of database names the user will become an admin of Required
name string User name Required
devops mongodb database add
Adds a database and the read-write users

Options

Name Type Description Required
name string Database name Required
users array Array of users with read-write privileges on the database.
devops mongodb database backup
Backup database(s)

Options

Name Type Description Required
name array Database name, if not defined it will backup all the databases
path string Path to destination folder of the backup

Configuration

bindip string
Binding IP address.
Default: 127.0.0.1
databases array
Array of databases, defines a database and the list of users with only read-write access
database.name string
Database name
Required
database.users array
Array of users with read-write privileges on the database. If the user does not exist it will be created. Do not specify users that are already admin of the database or they will loose their admin privileges.
dbpath string
Database files path.
Default: /var/lib/mongodb
enable string
Enable or disable mongodb service.
Default: yes
enable_rest boolean
Enable REST over the HTTP interface
logpath string
Database log file path.
Default: /var/log/mongodb/mongodb.log
nohttp string
Disable entirely the HTTP interface.
Default: false
port integer
Connection port.
Default: 27017
user string
Mongodb running user.
Default: mongodb
users array
Array of MongoDB admin db users. Passwords are randomly generated. A global admin user (named admin) is created automatically. The users defined here will be admin users of their respective databases
user.databases array
Array of database names where the user will be an admin
user.name string
User name
Required