Using Kundera with MongoDB: Creating a MongoDB Collection

We need to create a MongoDB collection in which to store the documents. Start the Mongo shell with the mongo command

>mongo

Create a collection called catalog with the following commands in Mongo shell. The first command sets the database to local. The second command drops the catalog collection.

>use local

>db.catalog.drop()

>db.createCollection(“catalog”)

The catalog collection gets created as shown in Figure 9-1.

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 *