质量为本、客户为根、勇于拼搏、务实创新
mongodb创建集合的有哪些方法
在MongoDB中,可使用createCollection()方法来创建集合。语法:
createCollection()
db.createCollection(name, options)
参数说明:
name
options
示例:
db.createCollection("myCollection")
上述示例将创建一个名为"myCollection"的集合。如果集合已存在,则会疏忽该操作。
TOP