作者在 2010-10-28 12:05:22 发布以下内容
删除数据库:
> use test
switched to db test
> db.foo.save({name:'asdfdsf'})
> show dbs
admin
local
test
> db
test
> db.dropDatabase()
{ "dropped" : "test", "ok" : 1 }
> show dbs
admin
local
>
switched to db test
> db.foo.save({name:'asdfdsf'})
> show dbs
admin
local
test
> db
test
> db.dropDatabase()
{ "dropped" : "test", "ok" : 1 }
> show dbs
admin
local
>
删除集合:
> use test
switched to db test
> db.foo.save({name:'sdfdsf'})
> show collections
foo
system.indexes
> db.foo.drop()
true
> show collections
system.indexes
>
switched to db test
> db.foo.save({name:'sdfdsf'})
> show collections
foo
system.indexes
> db.foo.drop()
true
> show collections
system.indexes
>