MongoDB 2.6 Upgrade
Table of Contents
Introduction
I noticed that I had been using MongoDB 2.4, where text search was in beta. Some code like the following was not going to work — outputDeal was null.
mycollection.textSearch(req.body.searchBox, searchOpt, function (err, outputDeal) {
var result = inspect(outputDeal, { depth: null });
console.info(result);
})
MongoDB 2.6 has more features. Key improvements include aggregation enhancements, text-search integration, query-engine improvements, a new write-operation protocol, and security enhancements.
Upgrade Steps
This blog provides how to upgrade from 2.4 to 2.6 by following these steps:
-
Dump your MongoDB data.
-
Download the binary 2.6 files.
-
Stop all services and apps using MongoDB.
-
Go to the MongoDB bin folder and replace all the DLLs with the new 2.6 versions.
-
Restart all services and apps using MongoDB.
-
You should be able to verify version 2.6 by typing
db.version().
After completing the above steps, I could verify that my first text search query was working.
Conclusion
Upgrading from MongoDB 2.4 to 2.6 is straightforward: dump your data, replace the binaries, and restart your services. The upgrade enables full text search support and many other improvements over the 2.4 beta features.