开发者社区> 问答> 正文

学习MongoDB基本操作中如何插入文档

学习MongoDB基本操作中如何插入文档

展开
收起
不变的狗子 2021-09-28 11:31:32 778 0
1 条回答
写回答
取消 提交回答
  • 热爱技术
    db.products.insertOne( { item: "card", qty: 15 } );
    insertMany
    db.products.insertMany( [ { _id: 10, item: "large box", 
    qty: 20 }, { _id: 11, item: "small
    box", qty: 55 }, { _id: 12, item: "medium box", qty: 30 } 
    ] );
    Insert
    db.collection.insert( <document or array of 
    documents>, { writeConcern: <document>, ordered: 
    <boolean> } )
    
    

    资源来源:电子书《玩转MongoDB从入门到实战》,下载链接:https://developer.aliyun.com/topic/download?id=1060

    2021-09-28 11:32:53
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
Data as a Service - 数据即服务 -- MongoDB⾼级应⽤模式 立即下载
MongoDB多数据中心的方案选型之路 立即下载
饿了么高级架构师陈东明:MongoDB是如何逐步提高可靠性的 立即下载