Migrating Couchbase to MongoDB: Creating Java Classes

We shall migrate a MongoDB database document to Couchbase Server in a Java application. Create two classes: CreateCouchbaseDocument and MigrateCouchbaseToMongoDB.

  1. To create a Java class select File New Other.
  2. In the New window, select Java Class and click on Next as shown in Figure 7-6.

  1. In New Java Class wizard select the Source folder and specify Package as mongodb. Specify class Name as CreateCouchbaseDocument and click on Finish as shown in Figure 7-7.

  1. Similarly, add a class MigrateCouchbaseToMongoDB as shown in Figure 7-8.

The two classes CreateMongoDB and MigrateMongoDBToCouchbase are shown in Package Explorer as shown in Figure 7-8.

 

Source: Vohra Deepak (2015), Pro MongoDB™ Development, Apress; 1st ed. edition.

Leave a Reply

Your email address will not be published. Required fields are marked *