插入方法

MongoDB 提供了以下方法将文件插入集合

db.collection.insertOne() 将单个文档插入到集合中。
db.collection.insertMany() db.collection.insertMany()将多个文件插入集合中。
db.collection.insert() db.collection.insert()将单个文档或多个文档插入到集合中。

插入的其他方法

以下方法还可以向集合中添加新文档:

有关更多信息和示例,请参阅方法的各个 reference 页面。

译者:杨帅

校对:杨帅

参见

原文 - Insert Methods

Copyright © 上海锦木信息技术有限公司 all right reserved,powered by Gitbook文件修订时间: 2023-09-01 17:10:26

results matching ""

    No results matching ""