By Qinghai | February 12, 2018
Today, we're happy to announce the release of NoSQLBooster 4.5. This version introduces a bunch of significant improvements SQL Query for MongoDB along with some minor improvements and bugfix.
If you’re not familiar with NoSQLBooster(formerly MongoBooster), it is a shell-centric cross-platform(Windows, Mac, Linux) GUI tool for MongoDB v2.6-3.6, which provides fluent query builder, SQL Query, update-in-place, ES2017 syntax support and true intellisense experience.
NoSQLBooster Download Link
How to Query MongoDB with SQL?
Hotfix
Hotfix in MongoBooster 4.5.6
- Fixed, unable to do a CSV export, throw "mongo.convertBsonObjToCsvStr is not a function"
Hotfix in MongoBooster 4.5.5
- Fixed, AppImage icon does not show up in Ubuntu GNOME #ref
- Fixed, sorting a table by Int or Double column sorts them as a string #ref
- Added, two new items to context menu of "table" view. 'Copy Document(s) to Clipboard - Tab-Separated Values' and 'Copy Document(s) to Clipboard - Comma-separated Values'
- Improved, "showIndex" code template for MongoDB sharded cluster
Hotfix in MongoBooster 4.5.4
- Added, auth option: Always ask for password when connecting to MongoDB database #ref
- Improved, export to CSV, Add a BOM character at the beginning of the csv to make Excel displaying special characters correctly
- Fixed, a minor UI bug in displaying recent history scripts
Hotfix in MongoBooster 4.5.3
- Fixed, east asian language input does not work properly #ref
- Fixed, $unwinds, cannot select middle item on the tree #ref
- Fixed, instanceof keyword is not working as intended bug #ref
- Fixed, mongo.NumberInt(
${record[key]}
) throws an error when record[key] = 10004743968 #ref - Fixed, Int64 truncated as Int32 bug in table & tree view #ref
- Fixed, out of range bug when importing a table-view from MSSQL with more than 1000 rows #ref
- Fixed, convert ObjectId to hexadecimal string bug #ref
Hotfix in MongoBooster 4.5.2
- New, "New Shell Tab..." and "New SQL Query Tab..." buttons to main toolbar
- New option, Menu->Options-> Output Panel-> Keeping Input Focus on the Editor After Running (default false)
- Improved, If the script does not need to be executed immediately, the editor window is maximized by default
- Improved, Using IndexedDB instead of local storage to store history scripts
- Changed, Export features will be disabled after the trial period
Hotfix in MongoBooster 4.5.1
- New, SQL Query: add RegExp Constructor Function e.g. select * from table where name = RegExp('^hai','i')
- Fixed, a bug when storing history script ref
- Fixed, a shell and C# generator bug ref
- Fixed, NoSQLBoooster runs out of Memory with Big BSON Documents => blank screen. ref
- Enabled MongoDB Enterprise Connection in free edition
SQL Query Improvements
The "toJS" SQL Function and named parameter
NoSQLBooster 4.5 supports named parameter in SQL function. The new “toJS” helper function transforms the named parameters and arithmetic operator to a JSON object, also transforms an ordinary parameter list into an array.
1 | toJS(k='v'); //result {k:'v'} |
With named parameter and "toJS" helper function, you can query complex objects or pass JSON-object parameter to a SQL function.
1 | --elemMatch, named parameter and Arithmetic operators |
Mixed use of SQL and Chainable Aggregation Pipeline
This feature already existed in previous versions, but in 4.5, mb.runSQLQuery returns AggregateCursor instead of DBCursor. This allows NoSQLBooster Intellisense to know all AggregateCursor's chainable stage methods. (sort, limit, match, project, unwind...)
1 | mb.runSQLQuery(` |
The equivalent MongoDB Query is a bit longer.
1 | db.survey.aggregate( |
Querying Special BSON Data Types, UUID, BinData, DBRef...
NoSQLBooster 4.5 supports all MongoDB build-in Data Types functions. To query values of these special BSON Data types, just write the values as you would in the MongoDB shell.
1 | --date |
Date Functions with Optional Timezone
NoSQLBooster 4.5 adds the timezone support for all SQL Date functions(Aggregation Operators), this feature requires MongoDB 3.6 or later.
1 | SELECT date, |
Improved GROUP BY Clause
The improved GROUP By clause supports MongoDB Pipeline Operators and SQL Aliases.
1 | mb.runSQLQuery(` |
The following is equivalent MongoDB Aggregation Pipelines. Compare these two statements, it is clear that the SQL SELECT is simpler and easier to write and read than the MongoDB JSON-LIKE aggregation pipelines.
1 | db.employees.aggregate( |
Better Error Handling in SQL Query
All exceptions thrown when running a SQL Query have associated location information.
SQL Editor Mouse Hover
The mouse hover will show many useful information, such as document and example.
Press F1 will lead you to MongoDB online document as the cursor is over a valid MongoDB function or aggregation operator.
Lots of New SQL Snippets
NoSQLBooster 4.5 includes a lot of SQL-specific code snippets to save you time, Date Range, Text Search, Query and Array, Existence Check, Type Check and so on. You can always manually trigger it with Ctrl-Shift-Space. Out of the box, Ctrl-Space, Alt-Space are acceptable triggers.
SQL Date Range Snippets
1 | -- Enter "daterange [Tab]", then... , today, yesterday, lastNDays |
Text Search Snippets
1 |
|
The equivalent MongoDB Text Search
1 | db.collection.find({ |
Query an Array ($all and $elemMatch) Snippets
The $elemMatch operator matches documents that contain an array field with at least one element that matches all the specified query criteria.
- Element Match with Embedded Documents
The elemMatch query criteria (quantity>2, quantity<=10) will be translated as *** "quantity": { "$gt": 2, "$lte": 10 }***. This syntax is more concise and expressive.
1 | -- Enter "elemem [Tab]", then... |
The equivalent MongoDB Query
1 | db.survey.find({ |
- Element Match
1 | -- Enter "elem [Tab]", then... |
The equivalent MongoDB Query
1 | db.survey.find({ |
The $all array operator selects the documents where the value of a field is an array that contains all the specified elements.
1 | -- Enter "all [Tab]", then... |
Existence Check and Type Check Snippets
- Existence Check ($exists)
1 | -- Enter "exists [Tab]", then... |
- Querying by Multiple Data Type ($type)
1 | -- Enter "typeSearch [Tab]", then... |
Other Notable Improvements
Improved tooltip of Index Node
Statistics on the index use will be displayed in the tooltip of index node.
Auto-Detect MongoDB URI
Starting with version 4.5, NoSQLBooster can detect whether you have a MongoDB URI in your clipboard and auto-populate the connection dialog from the URI.
Show the Recent Access Time of the Connection
Minor Improvements and Bugfix
- Improved, Humanize Array values in the table view, show as "(3) [1, 2.0 ,'3']"
- Changed, the default sample size of schema analysis increases from 100 to 1000
- Changed, default database name of test data generator dialog from "test" to the current db
- Added, "View Index Statistics ($indexStats)" menu item to indexes sub items of the collection node
- Upgraded from Chrome 58.0.3029.110 to 59.0.3071.115
- Upgraded from Node 7.9.0 to 8.2.1
- Enabled SSL connection in free edition
Thank you!
Please visit our feedback page or click the “Feedback” button in the app. Feel free to suggest improvements to our product or service. Users can discuss your suggestion and vote for and against it. We’ll look at it too.