This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> db.substring.find({},{_id:0,machine:1}) | |
{ "machine" : "foo.apple.com" } | |
{ "machine" : "bar.facebook.com" } | |
{ "machine" : "baz.mongodb.org" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> db.substring.aggregate({"$project":{"_id":0, "machine":1, "shortName":{"$substr":[field,array[searchStart],999]}}}) | |
{ "machine" : "foo.apple.com", "shortName" : "apple.com" } | |
{ "machine" : "bar.facebook.com", "shortName" : "facebook.com" } | |
{ "machine" : "baz.mongodb.org", "shortName" : "mongodb.org" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
test@test:PRIMARY(2.4.8) > rs.conf() | |
{ | |
"_id" : "test", | |
"version" : 5, | |
"members" : [ | |
{ | |
"_id" : 0, | |
"host" : "asyasmacbook.local:40001" | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mydb@PRIMARY(2.5.5-pre-) > db.repairDatabase() | |
{ "ok" : 1 } | |
mydb@PRIMARY(2.5.5-pre-) > db.stats(1024*1024) | |
{ | |
"db" : "mydb", | |
"collections" : 6, | |
"objects" : 1015, | |
"avgObjSize" : 24.33103448275862, | |
"dataSize" : 0, | |
"storageSize" : 1024, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
asyasmacbook:tests asya13$ rm /data/db/mydb.[12] | |
asyasmacbook:tests asya13$ ls -1shtr /data/db/mydb.* | |
16M Jan 13 20:37 /data/db/mydb.ns | |
64M Jan 13 20:37 /data/db/mydb.0 | |
asyasmacbook:tests asya13$ ps ax | grep mongod | grep -v grep | awk '{print $1}' | |
65176 | |
asyasmacbook:tests asya13$ lsof -p 65176 | |
mongod 65176 asya13 txt REG 1,2 16777216 3984323 /data/db/mydb.ns | |
mongod 65176 asya13 txt REG 1,2 67108864 3984324 /data/db/mydb.0 | |
mongod 65176 asya13 txt REG 1,2 134217728 3984325 /data/db/mydb.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16M /data/db/mydb.ns | |
64M /data/db/mydb.0 | |
128M /data/db/mydb.1 |
NewerOlder