MongoDB集合操作

MongoDB集合操作

创建集合

db.createCollection(name, options)
  • name: 要创建的集合名称
  • options: 可选参数, 指定有关内存大小及索引的选项

在这里插入图片描述

查看已有集合

show collections  

show tables

在这里插入图片描述

当直接创建文档时,集合会自动创建

删除集合

db.collection.drop()

在这里插入图片描述

发布了121 篇原创文章 · 获赞 189 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_45163122/article/details/104750028