![]() ![]() (Optional) If true, It automatically creates the index on the _id field. If you declare it as true then you need to specify the size parameter also. the capped collection is a fixed size collection that overwrites its oldest entries when it gets to its maximum size. (Optional) If true, then it allows a capped collection. The options parameter is optional, there we used the following list of options: Field In this, we write about memory size and indexing Write the name of the collection that you want to create. With the help of this table, you can easily understand how exactly you can use these two parameters of the createCollection() function Parameter Syntax: db.createCollection(name, options) But we don’t need to create a collection because MongoDB creates a collection automatically when we insert documents into the collection.
0 Comments
Leave a Reply. |