A first peek at the next MongoDB


MongoDB Inc have recently released a build of MongoDB 3.3.5. For those that don't know how MongoDB versions are numbered, the odd minor version denotes a development release which will eventually become version 3.4 in the fullness of time.

At Compose we like to have a quick peer into the JIRA issues repository and see what things could well be coming. The 3.3 branch has been in development since January and now, five versions in, we thought it would be a good time to have that look. Here are some of the things that caught our eye...

Aggregation enhancements

The addition of a $switch operator to the aggregation framework in SERVER-10689 means that future aggregations which need more complex branching will be a lot more readable and maintainable. The $reduce operation from SERVER-17258 should make rolling up of arrays of results easier too. It allows arrays to be processed with a function to reduce them down to a single value and is a spiritual partner to the existing $map operator.

There's also the $in from SERVER-6146 which adds a standalone version of the array matching function to the aggregation framework. Date handling is also set to be improved with ISO versions of $week, $year and $dayOfWeek and $dateToString operators being added with SERVER-7695.

Those are features in 3.3.5, but looking slightly ahead, 3.3.6 will add some string indexing SERVER-8951 in the form of $indexOfBytes, $indexOfCP and $indexOfArray.

Decimal numbers

One interesting feature which is still up in the air as of writing this, is support for decimal128 format numbers. The currently experimental decimal data type would allow for very large decimal values with up to 34 decimal digits in them. The feature is being tracked in SERVER-1393 . There's a lot of engineering involved in adding a new data type though 3.3.5 sees keystring and indexing support SERVER-19703 being added for the new data type.

Explain it more

To help with more complex debugging of queries SERVER-4494 has been resolved so that where indexes are being shown in the explain output, they include what version of the index is in use. There's also a ticket SERVER-2235 which will add the number of IXSCAN seeks to explain's output to help distinguish between seeking through the index and actually scanning the collection.

Other changes

We tend to have been focussing on the user visible features of MongoDB, but there are various changes taking place in the background. There are, of course, hundreds of fixes and small enhancements to the MongoDB core, and browsing the repository at least gives the impression that with the enhanced testing, 3.4 will have improved reliability.

Beyond that though, we did note:

In brief

The next release of MongoDB, whenever that happens, currently at least, looks like a reliability release with some useful new features turning up and paying off some technical debt in the process. When will the release be? Who knows. We've only looked at closed tickets for development and with over 450 open/in progress tickets (details here) there's still plenty of work to be done and plenty of leeway to surprise us with new features.

Dj Walker-Morgan
Dj Walker-Morgan was Compose's resident Content Curator, and has been both a developer and writer since Apples came in II flavors and Commodores had Pets. Love this article? Head over to Dj Walker-Morgan’s author page to keep reading.

Conquer the Data Layer

Spend your time developing apps, not managing databases.