MongoDB 删除集合
语法:
drop() 命令的基本语法如下
db.COLLECTION_NAME.drop()
示例:
首先,检查可用的集合在数据库 example
>use example
switched to db example
>show collections
mycol
mycollection
itcast
>
现在删除集合名称为 mycollection
>db.mycollection.drop()
true
>
再次检查到数据库中的集合列表
>show collections
mycol
itcast
>
drop() 方法将返回 true,如果选择成功收集被丢弃,否则将返回 false
删除 MongoDB Schema 和 SQL Schema区别
SQL Schema Statements | MongoDB Schema Statements |
---|---|
|
|
当前内容版权归 piaosanlang 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 piaosanlang .