MongoDB - create a collection with specified properties

Professionaluser
Posted by Professionaluser under Sql Server category on | Points: 40 | Views : 261
We can define a collection in MongoDB with different properties (Capped, autoIndexID, size and max). Example for the same is as follows:

>db.createCollection("TestCollection", { capped  : true, autoIndexID  : true, size  : 6142800, max  : 10000 } )
{ "ok" : 1 }
>

Comments or Responses

Login to post response