- Fix Idea 14.1 compatibility + migrate to mongo java driver 3.0, thanks to pwilkin
- Changelog
- Important note: This release will be the last! As I announced in this blog post. I will work on nosql4idea plugin that will integrate Mongo and other Document Oriented Database such as CouchBase and Redis.
This plugin integrates MongoDB Servers with database/collections tree, Query Runner and Shell console.
This plugin was built with JDK 1.6 and ideaIC-13.1 version (Idea 12 is not supported anymore).
Download this plugin from your IDE (Mongo Plugin)
When you open the Mongo explorer, you will see an panel:
- To manager your Mongo servers, click on the Mongo Settings button located on the upper toolbar of the Mongo explorer Right Panel
- You can edit your mongo shell path with a test button
- To add a server, click on the [+] button and a dialog will appear
- Set a label for your server, this will be more convenient to distinguish each of them in the Mongo explorer
- Set the server info as the example in the above screenshot
- If your access is restricted to a specific database, just type it in the corresponding field
- Put your credentials if your server requires authentication
- You can also precise if your connection is SSL
- You can let the plugin connect to the server on the IDE startup by clicking on the corresponding checkbox
- If you want to hide some collections, you can put them in the Collections to ignore field.
- You can click on the Test Connection button to check your server configuration
The tree displays for each server all databases with its collections.
- To view the content of your server, just double-click on it.
- To view the content of a collection, double-click on it and the results will be displayed as same as a file tab. If you double-click on another collection, a new tab will appears side of the previous.
If you want clear a collection or database by right clicking on it and select Drop collection/database. Be cautious with this operation, it should not be used in a production environment.
The panel shows all documents of the collections (max 300 records by default).
You can copy the result and paste in a text editor.
If you want to run a find query, click on the Magnify icon or type CTRL+F shortcut.
The query panel will appear on the top.
Type your filter, projection or sort query fragment in JSON format (e.g.: { 'name': 'foo'}
)
If you want to run some aggregate queries, type your pipeline as following:
{'$operator1': {...}},
{'$operator2': {...}}
When you type CTRL+SPACE key shortcut a popup is displayed in which you can select a query operator.
Additionally, you can set a row limit.
When you are done, click on the Run button (or type CTRL+ENTER shortcut) to see the query results.
Note: If you use Ultimate Edition, JSON syntax highlighting is enabled.
Any document can be edited by double-clicking on the object id (or by right-clicking). A panel will be opened on the bottom.
You can edit the value either by double-clicking or by typing F2 key. You can delete a key by right-clicking on it and select Delete this
- Click on the save button to send the modification to the mongo server
- Click on the delete button to delete it You can add a key or value (depending on the structure of your document) by right-clicking on it and select Add a Key (or Add a Value). A dialog will appear.
Set the key name, type and value and then validate your form.
You can also edit a document from scratch by right-clicking in the result view and select Add (or by typing ALT+INSERT shortcut)
If you set the mongo client path (e.g. /usr/bin/mongo), you can run the console by clicking the menu item Tools -> Mongo Shell.
If you need to run a javascript file on your mongo server, just type CTRL+SHIFT+F10 (or right-clik in your file and select Run myscript.js file)
Select your server and your database then click on the run button.
I would like to thank:
- MongoDB team
- Mongo Java Driver team
- Jetbrains Team for the great sources of IntelliJ Community Edition which help me to improve this plugin
- Mark James author of the famfamfam web site who provides beautiful icons.
- Jean Baptiste Potonnier for the suggestion to create this plugin
- piddubnyi for adding drop database action
- Neko team, my first beta testers ;)
- All users of this plugin who sent me valuable suggestions.
- My wife and my daughters who support me to have fun in software development and also remind me my husband/father duty ;).
Some bugs were reported when installing the SNAPSHOT version of the plugin. Mainly some ClassNotFoundDefException
. This could happen whenever you have a previous version of the plugin already installed in the IDE.
To fix it, the steps should be as follow:
- Locate the IDE working directory. For WebStorm, it is
.WebStorm
and for Intellij, it is.IntelliJIdea
- In it, remove the snapshot and the stable versions from
<working_dir>/config/plugins
- Download again the right version for your target IDE
- Deflate the archive in the same folder
- You should have one instance of the plugin:
<working_dir>/config/plugins/mongo4idea-0.X.Y-SNAPSHOT
Restart your IDE and it should be ok :).