• 2.6.1 Changelog (page 846). 

• All issues closed in 2.6.1$^{667}$. 

## Major Changes 

The following changes in MongoDB affect both the standard and Enterprise editions: 

## Aggregation Enhancements 

The aggregation pipeline adds the ability to return result sets of any size, either by returning a cursor or writing the output to a collection. Additionally, the aggregation pipeline supports variables and adds new operations to handle sets and redact data. 

• The db.collection.aggregate() now returns a cursor, which enables the aggregation pipeline to return result sets of any size. 

• Aggregation pipelines now support an explain operation to aid analysis of aggregation operations. 

• Aggregation can now use a more efficient external-disk-based sorting process. 

• New pipeline stages: 

• New or modified operators: 

## Text Search Integration 

– $out stage to output to a collection. 

– $redact stage to allow additional control to accessing the data. 

– set expression operators . 

– $let and $map operators to allow for the use of variables. 

– $literal operator and $size operator. 

– $cond expression now accepts either an object or an array. 

Text search is now enabled by default, and the query system, including the aggregation pipeline $match stage, includes the $text operator, which resolves text-search queries. 

MongoDB 2.6 includes an updated text index (page 500) format and deprecates the text command. 

## Insert and Update Improvements 

Improvements to the update and insert systems include additional operations and improvements that increase consis- tency of modified data. 

• MongoDB preserves the order of the document fields following write operations except for the following cases: 

– The _id field is always the first field in the document. 

– Updates that include renaming of field names may result in the reordering of fields in the document. 

• New or enhanced update operators: 

– $bit operator supports bitwise xor operation. 

