Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

MongoShell provides an interactive JavaScript shell with nearly identical syntax and functionality to the native mongo shell. We built it on top of FluidShell in order to provide you the ultimate combined functionality of a Unix Shell with a native mongo command line. All your mongo shell commands such as DB methods, DBCollection methods, commands to administer and maintain your MongoDB clusters, replica sets and shards are all available. Type help inside MongoShell to get a full list of supported commands.

MongoShell includes common Unix commands and functionality such as variable substitution, alias commands, command substitution, input/output redirection, pipelines and command history.

Image Added

Table of Contents


MongoShell for MongoDB Connections

Once you register a MongoDB server, right click on it to see MongoShell in the drop down menu. It appears just below FluidShell. Just like FluidShell, when MongoShell launches, it appears as a tab in the Main Application Workspace.

Image Added

Tabbed Interface & Docking Framework

The tabbed interface for MongoShell means it's easy to navigate multiple shells and multitask. If needed, you can float your tabs to separate windows and monitors. Color code your tab frames so that you can quickly identify what a particular MongoShell is for.

Image Added

Autocompletion

To autocomplete built-in functions, begin typing and press Ctrl+Space or Tab so you can quickly pick the one you need. Autocompletion in MongoShell works with built-in and user defined functions and objects.

Image Added

Sharding Methods

sh.help lists the sharding commands including commands which facilitate in creating shards, moving chunks from one shard to another, tagging shards and turning the balancer on and off and more.

Replication Methods

rs.help lists the replica commands including commands which facilitate in checking replica set status, checking who is primary, checking the oplog size and more.

Collection Methods

All of the db.collection methods are available, such as db.collection.aggregate() for providing access to the aggregation framework pipeline,and db.collection.validate() for performing diagnostic operations on a collection.

Cursor Methods

The Cursor Methods are accessible in MongoShell including cursor.addOption() for adding special wire protocol flags that modify the behavior of a query, and cursor.objsLeftInBatch() for returning the number of documents left in the current cursor batch.

Database Methods

db.help() lists all of the DB Methods accessible in MongoShell including db.cloneDatabase, db.killOp and db.printShardingStatus.

Take Complete Control

MongoShell provides you a near complete replacement for the command line shell shipped with MongoDB. You get complete control of your MongoDB deployment within a FluidShell-like interface along side all of our MongoDB visual editing tools and Query Analyzer.

Image Added

Copy, Paste, Find, Reconnect

The toolbar at the top of every MongoShell has buttons for pasting from the clipboard and finding in the buffer. Simply drag across content to copy it to the clipboard. The Find button makes it easy to track down the needle in a haystack of JSON content with Find Previous and Find Next. Reconnect is useful if a connection is lost due to network timeouts or congestion.

Image Added

MapReduce

help mr displays the MapReduce functions along with supported options such as keeptemp, sort and finalize

Show Profile

Use show profile to show the 5 most recent system.profile entries that are older than one millisecond. By using MongoDB's database profiler, you can collect fine grained data about write operations, database commands and cursors.

Export JSON Content

MongoShell allows you to view and export your content as JSON. Pipe your JSON content to a file or perform other operations using all of the FluidShell's built in commands.

Connection Methods

MongoShell allows use of all Connection Methods like Mongo.getDB() to return a database object, and Mongo.setSlaveOk() to allow operations on the current connection to read from secondary members.

Native Methods

Supports Native Methods like cat() for returning the contents of a specified file, and md5sumFile() to return md5 hash of a specified file.

...

Apache Derby registrations should be straight forward.

Contents

General Tab

Tab Coloring
To Identify Server Environments, whether it is a Production, Development or Test, use Tab Coloring feature:

  • Locate the Server in the Server Browser
  • Right-click on the Server - A Popup Menu Appears
  • Click on the Item which displays Server Properties.
  • Based on the Server Type, you can edit the Tab Coloring option to identify your environments.

Using the Keyboard combination "CTRL + SHIFT + P", you may quickly access Server Properties and edit Tab Coloring options.

Using Filters Options in Registration (Filter Tab)

Edit the Server Properties, to use FILTER options for a Server in Aqua Data Studio:

  • Locate the Server in the Server Browser
  • Right-click on the Server - A Popup Menu Appears
  • Click on the Item which displays Server Properties.
  • Go to the Filter Tab and make changes in the Options.
  • Filter Databases/Schemas: Allows the user to specify the main schema browser filter for databases or schemas, on whether to include or exclude all.
  • Include Databases/Schemas: A list of databases/schemas to include after the main filter is applied.
  • Exclude Databases/Schemas: A list of databases/schemas to exclude after the main filter is applied.
  • Filter Objects: Allows the user to specify the main schema browser filter for object types, on whether to include or exclude all.
  • Include Objects: A list of objects to include after the main filter is applied.
  • Exclude Objects: A list of objects to exclude after the main filter is applied.

...

  • You can Create, Edit or Delete Object Folders. Default Folders are Tables, System Tables, Views, Indexes, Triggers, Procedures, Functions.
  • Sometimes you would like to view only specific Schemas. Use options to INCLUDE or EXCLUDE all Schemas and Folders.
  • Enter the Schema or Folder name in the specified text area and Press OK. Current Connection will be terminated. Reconnect to see the changes.
  • Filters are case sensitive
  • Filter Databases works on the list of databases inside the "Databases" folder.
  • Filter Folders works on the list of folders inside a particular database. Example folders: Tables, View, Procedures, etc.
  • Object Folder filter works on individual folders inside a particular database. The user can define filters for each of the Tables, Views, etc. folders.

Using the drop-down at the top of the Filter Tab, quickly change your Schema or Folder View.
Filter Examples:
If your intention is to show only the tables that start with XXPKD, then you'll need to change your main filter to "Exclude All", and secondary filter to "XXPKD*". Note the "" in front of the XXPKD pattern. Also, note that the filter pattern is case sensitive.
The filter shown below is set to exclude all databases except those that start with "aq". This is similar to the above example where all schemas, except the XXPKD schema, are excluded. Then, there is an "Object Folder" filter on the Tables folder, which excludes everything except those that start with "forum".

Using Advanced Properties (Advanced Tab)

Edit the Server Properties to use Advanced Properties in Aqua Data Studio:

  • Locate the Server in the Server Browser.
  • Right-click on the Server - A Popup Menu Appears.
  • Click on the Item which displays Server Properties.
  • Go to the Advanced Tab and make changes in the Options.

  With options in Advanced properties of a Server, you can:

  • Change Transaction Isolation Modes.
  • Manage Driver Parameters.
  • Enable Database Filters in Query Analyzer.
  • Change Read Only / Read- Write Mode.
  • Change Object Folder Display.
  • Transaction Isolation Level: Support for setting Transaction Isolation Level- TRANSACTION_NONE - A constant indicating that transactions are not supported.- TRANSACTION_READ_COMMITTED - A constant indicating that dirty reads are prevented; non-repeatable reads and phantom reads can occur.- TRANSACTION_READ_UNCOMMITTED - A constant indicating that dirty reads, non-repeatable reads, and phantom reads can occur.- TRANSACTION_REPEATABLE_READ - A constant indicating that dirty reads and non-repeatable reads are prevented; phantom reads can occur.- TRANSACTION_SERIALIZABLE - A constant indicating that dirty reads, non-repeatable reads, and phantom reads are prevented.
  • JDBC Escape Processing: Allows JDBC driver to perform escape sequence before sending the SQL code to the server.
  • Display System Folders: Allows to show/hide System Tables in Tables.
  • Always Display Column Name in Results: Allows to show/hide column names in query results.
  • Enable DB Filters for Query Window: Enables/Disables db filters for query windows using this connection.
  • Only Display Databases that User has Access to: Displays only the databases the current user (from the Login Name on the General tab) has access to within the schema browser.
  • Fetch Size: Determines the Fetch Size (number of rows physically retrieved from the database at one time by the JDBC driver).
  • Connections Pooled: Enables connection pooling. Read more about connection pooling here.
  • Wiki Markup
    *Force Auto-Commit:* When this option is selected, it sets auto-commit to TRUE for any Query Window to this server and disables the icons on the toolbar, regardless of the option in *File > Options > Query Analyzer > \[DATABASE\] > \[Auto Commit\]{*}.
  • Data Warehouse Mode: Read Only or Read/Write
  • Wiki Markup
    *Object Folder Display:* \[Default\], \[Name\], \[Schema\].\[Name\] or \[Name\](\[Schema\]) sets how the Schemas will be displayed.

Using the drop-down at the bottom of the Advanced Tab, quickly change your Object Display in the Server Browser.

Using Driver Properties (Driver Tab)

Edit the Drivers Properties to use Driver Parameters in Aqua Data Studio:

  • Locate the Server in the Server Browser.
  • Right-click on the Server - A Popup Menu Appears.
  • Click on the Item which displays Server Properties.
  • Go to the Driver Tab and make changes in the Options.

  With options in Driver properties of a Server, you can edit/view the:

  • Driver: This displays the JDBC driver used for this connection.
  • Driver Parameters: This option is to allow a user to specify extra JDBC parameters that a user might want use in establishing a connection.
  • Connection URL: This displays the connection URL for this server connection.
  • Driver Parameters Quick filter: This option is to allow a user to search JDBC parameters that a user might want to use in establishing a connection.

Server Permissions (Permissions Tab)

  Edit the Permissions in Server Properties in Aqua Data Studio:

  • Locate the Server in the Server Browser
  • Right-click on the Server - A Popup Menu Appears
  • Click on the Item which displays Server Properties.
  • Go to the Permissions Tab and make changes in the Options.

  With options in Permissions Tab of a Server, you can:

  • Control Statement execution and Properties of the Query Analyzer, Table Data Editor, and Visual Editing.
  • Grant / Revoke Permissions easily for executing DDL and DML Statements in the Query Analyzer.
  • Change the behavior of the Table Data Editor for manipulating rows in Tables.
  • Grant / Revoke Alters, Creates, Drops and View Properties of Visual Editing Tools.

Server Scripts (Script Tab)

  Edit Scripts in Server Properties in Aqua Data Studio:

  • Locate the Server in the Server Browser
  • Right-click on the Server - A Popup Menu Appears
  • Click on the Item which displays Server Properties.
  • Go to the Script Tab and make changes in the Options.

  With scripts in the Script Tab of a Server, you can:

  • Enter an SQL script that is executed each time a new connection is established.
  • This allows the user to SET connection settings for a server connection. (eg: SET ROLE, ALTER SESSION SET XXX)

Shell Scripts (FluidShell Tab)

  Edit Shell Scripts in Server Properties in Aqua Data Studio:

  • Locate the Server in the Server Browser
  • Right-click on the Server - A Popup Menu Appears
  • Click on the Item which displays Server Properties.
  • Go to the FluidShell Tab and make changes in the Options.

  With scripts in the FluidShell Tab of a Server, you can:

  • Enter a FluidShell script that is executed each time a new FluidShell connection is established.
  • This allows the user to cd (change directory) for a server connection. (eg: cd /scripts)

Connecting to databases created with non-default collation properties

To connect to databases created with non-default collation properties, ensure that you are connecting to the SYS schema by entering the following in the Script tab: SET SCHEMA SYS

Server Connections (Connection Monitor Tab)

Enable the connection monitor to start an application thread that monitors the status of the connection associated with the Query Window.
With the connection monitor, you can:

  • Set a ping operation that allows activity on the connection to prevent the connection from being terminated.
  • Set an execute operation that executes the Query Window on a periodic basis.
  • Set an auto-commit operation that checks how long the auto-commit has been disabled and whether the idle threshold has been exceeded. A warning threshold can also be configured so users can turn on auto-commit before it happens.

...