文档基本插入_隐式创建
文档(document)的数据结构和 JSON 基本一样。 所有存储在集合中的数据都是 BSON 格式。
文档的插入
单个文档插入
使用insert() 或 save() 方法向集合中插入文档,语法如下:
db.collection.insert( <document or array of documents>, { writeConcern: <document>, ordered: <boolean> } )
db.dss.insert({"name":"dss"})


批量插入
db.collection.insertMany( [ <document 1> , <document 2>, ... ], { writeConcern: <document>, ordered: <boolean> } )
db.dss.insertMany([{"name":"dss"},{"name":"dss1"}])
python中列表套字节的方式

浙公网安备 33010602011771号