MongoDB 2.6 Upgrade

2014/08/022 min read
bookmark this
Responsive image

Table of Contents

  1. Introduction
  2. Upgrade Steps
  3. Conclusion

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:

  1. Dump your MongoDB data.

  2. Download the binary 2.6 files.

  3. Stop all services and apps using MongoDB.

  4. Go to the MongoDB bin folder and replace all the DLLs with the new 2.6 versions.

  5. Restart all services and apps using MongoDB.

  6. 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.