We shall migrate a MongoDB database document to Couchbase Server in a Java application. Create two classes: CreateCouchbaseDocument and MigrateCouchbaseToMongoDB.
- To create a Java class select File ➤ New ➤ Other.
- In the New window, select Java ➤ Class and click on Next as shown in Figure 7-6.
- 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.
- 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.