MonsterDB – Server Commands

Make your data beautiful again.


usage from API: void connect(host, port, username, password)nusage from CLI: java -jar monsterDB.jaru200b -h host -p port -u username -p password
nConnects to the remote server using TCP/IP protocol, host can be dns or ip address, port must be a valid integer but generally defaults to 27018, username and password are clear text versions of the authentication, this must be setup on the server, but in default installations are not required.


usage from API: void disconnect()nusage from CLI: disconnect

Disconnects from any server connection, this command will discard any session data including cursors, therefore you should exhaust any data cursors before doing this. Also note that a session will automatically disconnect after 5 minutes of inactivity and similarly cursor data will be discarded. This is in an attempt to save memory on the server.


usage from API: void createDatabase(name)nusage from CLI: create name

Creates a database if it does not exist, alternatively it will connect to an existing database without error. In the event that you have moved a database from one machine to another you may use this command to connect to the moved files. The create command will also set the current database in use in the CLI.


usage from API: void dropDatabase(databaseName)nusage from CLI: drop databaseName

Drops a database and all collections within it, this will destroy any data associated with the database including any metadata. Cursors referring to this database or collections will still be valid, however may become unstable.


usage from API: List<Document> listDatabaseNames()nusage from CLI: listDatabaseNames

Shows the currently available databases on the server. Return value is a list of documents each one containing a database name.


usage from API: useDatabase(databaseName)nusage from CLI: use databaseName

Connects the default database in the connection to the value supplied, all collection commands will be redirected to this database for evaluation, there is not need to refer to the database name in queries after this is called.


usage from API: setDebug(true|false)nusage from CLI: setDebug true|false
nIf the user requires more verbose output from the optimizer then set the debug to true, this will instruct the cost based optimizer to explain the query path and cost savings used when a user executes a more complex query.