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.
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.
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.
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.
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.
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.
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.