Migrating Couchbase to MongoDB

Both MongoDB and Couchbase are document-centric NoSQL databases. Both are based on the same data storage model, which is JSON, with a slight difference that MongoDB is based on the BSON (binary JSON) data model, which provides a wider selection of data types. The JSON support in Couchbase is relatively less developed. MongoDB stores documents in collections, which make it easier to handle documents. Mongo’s support for JavaScript methods that run in the Mongo shell to perform CRUD operations on the documents is another advantage over Couchbase. To make use of these added features in MongoDB, it may be advantageous to migrate documents from Couchbase to MongoDB. In this chapter we shall migrate Couchbase documents to MongoDB. This chapter covers the following topics: