What Is New in MongoDB 2.6
MongoDB 2.6 delivers a major step up in operational control, security, and query capabilities. It's a foundational release that introduces integrated automation and a more robust platform for large-scale deployments.
| Category | Key Changes |
|---|---|
| Security | Role-Based Access Control, Collection-Level Access, SSL for Replica Sets/Sharding |
| Query System | Bulk Write Operations, Index Improvements, $text Search Enhancements |
| Aggregation | Aggregation Pipeline Output to Collection, New Aggregation Stages & Operators |
| Operations | Background Indexing on Secondaries, Initial Sync Improvements, explain Enhancements |
| Deprecations | Deprecated Group Command, Old MMAPv1 Default Index Options |
How did security get stronger in 2.6?
The security model was completely overhauled. The biggest change is the introduction of Role-Based Access Control (RBAC), moving far beyond the simple read/write user model of earlier versions.
You can now define custom roles with precise privileges that can be scoped down to specific collections or sets of actions. SSL support was also extended to encrypt all internal communication within replica sets and sharded clusters, closing a major gap for secure deployments.
What aggregation pipeline upgrades should I know about?
You can now write the results of an aggregation pipeline directly to a new collection using the $out operator. This is a game-changer for creating persistent reporting collections or ETL workflows without writing application-side code to handle the output.
The pipeline itself got more powerful with new stages like $redact for conditional document filtering and operators like $ceil, $floor, and $mod for enhanced number crunching.
Why are the new bulk write operations a big deal?
They finally provide a way to perform efficient, ordered or unordered batches of insert, update, and remove operations through a single API call. Before this, you had to simulate bulk writes with individual requests, which was much slower due to network round-trips.
In practice, this means your mass data import or update jobs will run significantly faster and put less load on the driver and server. The ordered operations stop on the first error, while unordered operations continue through any errors.
What operational headaches did 2.6 solve?
Building indexes on secondaries no longer requires taking them out of rotation. You can now build indexes in the background on secondary members of a replica set, which maintains high availability during the operation.
The initial sync process for adding new replica set members was also optimized to be faster and more reliable. Furthermore, the explain command was enhanced to provide more detailed insight into query performance and index usage.
FAQ
Does the new RBAC system break my existing applications?
It can if you upgrade without preparation. The old auth schema is incompatible. You must upgrade your authentication data to the new 2.6 format using the authSchemaUpgrade command, and then update your user roles to fit the new model.
Can I use text search without a separate Solr or Elasticsearch setup now?
Yes, the integrated $text search operator became production-ready in 2.6. It supports text search with language-specific stemming, negation, and phrase matching, making it viable for many basic search use cases directly within MongoDB.
What's the main reason to use the new bulk API?
Performance. Sending a single request with 1000 operations is drastically faster than sending 1000 individual requests. It reduces network overhead and allows the server to process the batch more efficiently.
Is it safe to build indexes on secondaries in the background?
Yes, this is a major operational improvement. It allows you to maintain read availability from your secondaries while building new indexes, which was not possible before. The indexing process uses yielding to avoid blocking replication.
What happened to the group command?
It was deprecated in favor of the aggregation framework. The group command is less powerful and has significant memory limitations. The aggregation pipeline offers a much more flexible and performant way to achieve the same results and more.