MongoDB Commands
> show dbsuse dbnameuse newdb// create a collection
db.createCollection("myFirstCollection")
// collection with capped size
// The size: 2 means a limit of two megabytes, and max: 2 sets the maximum number of documents to two.
db.createCollection("mySecondCollection", {capped : true, size : 2, max : 2})show collections// drop database in MongoDB CE
db.dropDatabase()
Last updated