Skip to content

Instantly share code, notes, and snippets.

@asya999
Created January 14, 2014 04:42
Show Gist options
  • Save asya999/8413148 to your computer and use it in GitHub Desktop.
Save asya999/8413148 to your computer and use it in GitHub Desktop.
Messing with DB
mydb@PRIMARY(2.5.5-pre-) > for (i=0;i<1000;i++) db.bar.insert({})
Insert WriteResult({ "ok" : 1, "n" : 1, "lastOp" : Timestamp(1389674231, 506) })
mydb@PRIMARY(2.5.5-pre-) > db.createCollection("cap",{capped:true,size:1024*1024*1024})
{ "ok" : 1 }
mydb@PRIMARY(2.5.5-pre-) > db.stats(1024*1024)
{
"db" : "mydb",
"collections" : 6,
"objects" : 1015,
"avgObjSize" : 24.28768472906404,
"dataSize" : 0,
"storageSize" : 1024,
"numExtents" : 7,
"indexes" : 4,
"indexSize" : 0,
"fileSize" : 2239,
"nsSizeMB" : 16,
"dataFileVersion" : {
"major" : 4,
"minor" : 5
},
"ok" : 1
}
mydb@PRIMARY(2.5.5-pre-) > ^Z
[1]+ Stopped mongo mydb
asyasmacbook:tests asya13$ ls -1shtr /data/db/mydb.*
16M Jan 13 20:37 /data/db/mydb.ns
2.0G Jan 13 20:37 /data/db/mydb.2
128M Jan 13 20:37 /data/db/mydb.1
64M Jan 13 20:37 /data/db/mydb.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment