![]() ![]() “Options” is a document used to denote the configuration of a collection, including memory size and In the Create Collection method, “name” is the name of the collection created. Given is a syntax of the Create Collection Method that can be used to create a collection in MongoDB: db.createCollection(collection_name, options) Name and Options Limit, overwriting of old entries will start. MongoDB creates a collection for an inserted command automatically if no similar collection already exists in theįor example, To create a capped collection, insert the following command,ĭb.createCollection(“teachers”,Īfter inserting this command, a collection named “teachers” having a max size of 9232768 bytes will be created in the MongoDB database. Of which one way is by using db.createCollection(name, options). Several ways can be employed to create and remove collections in MongoDB. In relational databases, there are tables, while in MongoDB, there are collections, which are capable of storing documents of diverse or dissimilar types.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |