Start mongod with --quota --quotaFiles 1 --smallfiles
> db.foo.dropDatabase()
Wed Jan 18 19:08:42 TypeError: db.foo.dropDatabase is not a function (shell):1
> db.dropDatabase()
{ "dropped" : "test", "ok" : 1 }
> x = 'x'
x
> while (x.length < 1024*1024) x += x; x.length
1048576
> for (var i=0; i< 20; i++ ){ db.foo.save({_id:i, x:x}) }
quota exceeded
> db.foo.find({_id:0}, {_id:1})
{ "_id" : 0 }
> db.foo.count()
16
All good to this point
> db.foo.save({_id:0, x:x+x}) //boom
quota exceeded
> db.foo.find({_id:0}, {_id:1})
> db.foo.count()
15
I'll commit a test for this tomorrow.