le-yams / nbmongo Goto Github PK
View Code? Open in Web Editor NEWThis project forked from timboudreau/netbeans-mongodb
A NetBeans plugin for browsing MongoDB
License: Other
This project forked from timboudreau/netbeans-mongodb
A NetBeans plugin for browsing MongoDB
License: Other
Add support for all index key types. For now only asc/desc type are supported and this cause various bugs.
Stacktrace:
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
at org.netbeans.modules.mongodb.indexes.Index.fromDBObject(Index.java:70)
at org.netbeans.modules.mongodb.ui.explorer.IndexNodesFactory.createKeys(IndexNodesFactory.java:44)
at org.openide.nodes.AsynchChildren.run(AsynchChildren.java:209)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
Hi,
It seems that in order to establish a connection the plugin automatically tries to execute the command listDatabases: 1
however the user I'm connecting with doesn't have permission to do that so I can't connect.
Is it possible to instead of doing listDatabase: 1
do getCollectionNames
for example? (or if listDatabase
fails do getCollectionNames
? (like in MongoHub where even though you can't see DB details, you can still list/view/edit collections ).
Using NB 8.0.2 with 8.1.0 NBMongo plugin.
As of now, when a collection is opened, there is no way to open it again in another tab. It would be very useful to be able to browse a single collection in multiple tabs, so one could work on them with different criteria, projections, etc...
When removing the "_id" field through a projection, the result tree view display no result.
When using the flat table while browsing collection with fields limited by "projection", it would be nice if the table would not display (blank) columns of other fields.
One more extra feature could be to allow other table layouts. The only one available now is that all the columns are forced to fit view port's width (no horizontal rule), with rich collection structures nothing is visible.
I am using Mongo 3.0.3 and your plugin with Auth enabled.
When I attempt to connect to a db which requires auth it fails with the following error. Access from the terminal with the same credentials work fine.
com.mongodb.CommandFailureException: { "serverUsed" : "127.0.0.1:27017" , "ok" : 0.0 , "errmsg" : "not authorized on admin to execute command { dbstats: true }" , "code" : 13}
at com.mongodb.CommandResult.getException(CommandResult.java:76)
at com.mongodb.CommandResult.throwOnError(CommandResult.java:140)
at com.mongodb.DB.getStats(DB.java:477)
at org.netbeans.modules.mongodb.ui.explorer.DBNode.createSheet(DBNode.java:110)
at org.openide.nodes.AbstractNode.getSheet(AbstractNode.java:441)
at org.openide.nodes.AbstractNode.getPropertySets(AbstractNode.java:457)
at org.openide.nodes.FilterNode.getPropertySets(FilterNode.java:630)
at org.openide.actions.PropertiesAction$DelegateAction.getPopupPresenter(PropertiesAction.java:194)
at org.openide.util.Utilities.actionsToPopup(Utilities.java:1729)
at org.openide.util.Utilities.actionsToPopup(Utilities.java:1815)
at org.openide.explorer.view.TreeView.createPopup(TreeView.java:1058)
at org.openide.explorer.view.TreeView$PopupAdapter.showPopup(TreeView.java:1555)
at org.openide.awt.MouseUtils$PopupMouseAdapter.maybePopup(MouseUtils.java:189)
at org.openide.awt.MouseUtils$PopupMouseAdapter.mouseReleased(MouseUtils.java:184)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6525)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6290)
at java.awt.Container.processEvent(Container.java:2234)
at java.awt.Component.dispatchEventImpl(Component.java:4881)
at java.awt.Container.dispatchEventImpl(Container.java:2292)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462)
at java.awt.Container.dispatchEventImpl(Container.java:2278)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4703)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:75)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
In the dialog to add an index key when creating an index, the field name validation is not performed until the textfield is modified. The result is that it is possible to create an index key with an empty field name.
Note: Empty string field names are technically allowed in mongo documents but they are not wanted and may be disallowed in a future version. See mongo issue 6852.
The databases are not sorted (the collections within a database are). I have like a few dozen databases and it's really uncomfortable.
I've been using nbmongo for a while now without issue across multiple servers running various versions of the database.
Today I configured a server to run using the wiredTiger storage engine to see if it was worth migrating and NBMongo won't connect. I cloned the server and ran Mongo with MMapv1 and it works fine.
Is anybody else having this issue?
After I create a MongoDB connection in the Netbeans Services panel, I then try to create a database. The Create database hangs Netbeans. It appears to be waiting for input for a database name but you cannot enter a name. Any ideas what is wrong?
Thanks.
I create this issue regarding to @witoldsz comment in #36
Hi,
I am wondering if that would not be more comfortable to replace the Criteria, Projection, Sort trio (featuring edit/clear buttons and modal editor) with just one text area with plain JSON and history of that texfield similar to the one of (JDBC) Databases bundled with NetBeans.An extra advantage is that there would be no extra "click steps" required to get into the query (1st is edit button, then if 2nd one to get to projection or sort, then 3rd click to accept and close the editor).
Maybe something like this:
{{query: {}, projection: {}, sort: {}}
As you can't simply copy/paste a query to reproduce it, it would be nice to implement save/open functionality for that, or maybe keep the connection tab open after an IDE restart
System: Linux version 3.13.0-76-generic running on amd64; UTF-8; en_US (nb)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
NetBeans: 8.1 (Build 201510222201),
NBMongo: 8.2.0
I was testing the export feature and it did not really worked. When exporting as a JSON array, the file had only one character: [
and nothing more. When exporting as document per line, the file was completely blank.
In the IDE log, I have found this:
INFO [org.mongodb.driver.connection]: Opened connection [connectionId{localValue:3, serverValue:6}] to mongodb.service.consul:27017
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.netbeans.modules.mongodb.util.Exporter
java.lang.NullPointerException
at org.netbeans.modules.mongodb.util.Exporter.export(Exporter.java:78)
at org.netbeans.modules.mongodb.util.Exporter.exportTo(Exporter.java:59)
at org.netbeans.modules.mongodb.util.Exporter.run(Exporter.java:45)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
After rebooting NetBeans, the error did not happen again. Now I cannot reproduce it any longer.
Also, it seems the exception was mishandled somewhere, because it should notify about the problem and not fail silently. Only after opening the (blank) file I noticed something was wrong.
In the plugin manager I see MongoNb and NBMongo, I think these are 2 different Plugins but wouldn't it be better to work together? I don't know the functionality of both atm but I think it would be better to work in a team. Here is the other plugin which is still alive I think: http://sourceforge.net/projects/mongonb/
Here is an other but I think its not alive anymore, but I don't know: http://timboudreau.com/modules It's called Netbeans-mongodb, it's the second from below.
Regards
Chris
The criteria currently doesn't support mongo specific syntax criteria such as ObjectId("...") which are not valid json.
Typically in system.indexes collections, documents has no "_id" field.
If so then the tree table document node display "null" as text and the flat table has an empty "_id" column.
I'm using a dark laf and having trouble with low contrast between bg color and foreground color when opening a collection in a new tab (light grey on white) is it possible to change this combo and where might I find it in fonts and colors (I've looked) Great plugin and glad to see this for NB!
Ideally I'd like a place where I can write my own complex queries and statements without the restrictions of the criteria/projection/sort window or complex updates and deletes.
i.e db.mycollection.find({some criteria}).forEach(function(res){...})
I couldn't find a way to do this. Am I missing something or is there a way to achieve this?
Stacktrace:
java.lang.NullPointerException
at org.netbeans.modules.mongodb.ui.util.DatabaseNameValidator.validate(DatabaseNameValidator.java:57)
at org.netbeans.modules.mongodb.ui.util.ValidatingInputLine.performValidation(ValidatingInputLine.java:56)
at org.netbeans.modules.mongodb.ui.util.ValidatingInputLine.access$000(ValidatingInputLine.java:42)
at org.netbeans.modules.mongodb.ui.util.ValidatingInputLine$1.insertUpdate(ValidatingInputLine.java:72)
at javax.swing.text.AbstractDocument.fireInsertUpdate(AbstractDocument.java:202)
at javax.swing.text.AbstractDocument.handleInsertString(AbstractDocument.java:749)
See issue details at https://netbeans.org/bugzilla/show_bug.cgi?id=256073
There are two display modes for a collection's data: tree and a flat table. It would be awesome to have third option to see a result set as a JSON text, like:
/* 0 */
{
"_id": "123",
"somethin": "else"
}
/* 1 */
{
"_id: "456",
"another": "..."
}
/* 2 */
{...etc...}
It would really help a lot!
I'm running mongoDB version 3.0.6 under OS X. Netbeans 8.1
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.openide.nodes.AsynchChildren │
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number │
at org.netbeans.modules.mongodb.indexes.Index.fromDBObject(Index.java:70) │
at org.netbeans.modules.mongodb.ui.explorer.IndexNodesFactory.createKeys(IndexNodesFactory.java:44) │
at org.openide.nodes.AsynchChildren.run(AsynchChildren.java:209) │
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443) │
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68) │
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303) │
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)
The properties window for collections and databases is not updated.
On the other hand, I don't see how you can fix this when you use mongo's projection function to suppress the display of field information.
It surprised me when it happened. I can imagine use cases when someone would want that behavior, but it's pretty dangerous. Perhaps a flag that disallows row edits when the projection field isn't empty or a warning when you try?
Failure to authenticate with MongoDB 3.0 to users with SCRAM, success only with MONGODB-CR.
For more informations see, http://www.mongodb.com/blog/post/improved-password-based-authentication-mongodb-30-scram-explained-part-1
Tks
When I try to edit a big document the "Edit document" window is not scrollable, i.e. it is neither showing a scrollbar nor scrollable using the mouse wheel.
Add an action to clear an entire collection (removes all documents but doesn't delete the collection itself).
A confirmation dialog must be shown.
Only ascending/descending index key type are supported.
Support for text/hashed/2d/2dsphere/geoHaystack has to be added.
Lot of database accesses related code is executed in EDT. It must be done in background thread with workers.
How do I get a document from a collection by passing an _id as criteria?
I tried different variations of the following syntax:
"_id":"5523bc30b0f9671016e9d152"
but then I get an "invalid criteria json" ..is there a manual or documentation somewhere for future reference?
It would be useful if one could pick a property of a document and chose one of the two options mentioned in a title. Another version would be not to add, but to replace the projection/sort instead. The decision is to be made :)
When a collection view is selected and an other editor tab is selected then comming back to the collection view reload the results and then reset the results displaying
Hi,
I could not connect to my new MongoDB today. There were no errors during connection, the icon was not "broken", I could disconnect and connect again, but the database was looking like empty.
The problem was, when I was pasting the Mongo URI, I had one "space" character at the end.
It would be nice if the URI string could be trimmed on save.
In the context menu of a collection result view, an action may allow to query the collection using a field value as criteria.
The action may be available only on simple type field (string, numeric, boolean)
The result view json property context menu currently have "Copy key" and "Copy value" actions. A "Copy key/value pair" action should be added.
Take advantage of mongodb java driver v3 bson types support.
This is an enhancement request.
It's maddening to have to visually search through the fields to find the one you want when they are given in hash order. Yes, I could suppress the other fields via a projection but I don't see why anyone would prefer the field keys in random order versus sorted order.
The nbmongo project is really good. NetBeans is also good, but as far as I can tell, people using other IDE's are having hard time installing NetBeans even if it's just to host the "nbmongo". What's worse, they won't even find this when looking for a "MongoDB client app" or something similar.
I guess it could help this project if it was released also as a standalone application.
In the properties sheet of a connection node, the mongo uri property is not displayed when the connection is active ("(No Property Editor)" is shown instead).
The mongo uri should be displayed (in read only because of the active connection).
Exception expanding indexes in explorer
java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Number
at org.netbeans.modules.mongodb.indexes.Index.fromDBObject(Index.java:70)
at org.netbeans.modules.mongodb.ui.explorer.IndexNodesFactory.createKeys(IndexNodesFactory.java:44)
at org.openide.nodes.AsynchChildren.run(AsynchChildren.java:209)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
It is only a little enhancement but I would prefer to find the Mongo DB node under the Database node, because it is a database. The other plugins like NbCassandra and Couchbase for netbeans are inside the Database node too. Maybe if I have time, I will do a pull request for this. It is my opinion but I think it makes sense.
Opening document that has backslashes in one of fields probably badly unescapes these 's and removes them from the value, effectively breaking the database.
See:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.