总结

1. CRUD:createreadupdate, and delete DOCUMENT

2.在3.2版本的插入方式

db.collection.insertOne()
db.collection.insertMany()

db.users.insertOne(
{
name:"sue",
age:26,
status:"pending"

}
)

  

3 Read 操作

db.users.find(
{
age:{$gt:18},
name:1,address:1
}
)

4 Update操作

db.collection.updateOne()
db.collection.updatMany()
db.collection.replaceOne()

db.users.find(
{
age:{$gt:18},
name:1,address:1
}
)


5 Delete操作

db.users.deleteOne()
db.users.deleteMany()

CRUD operations createreadupdate, and delete documents.

Create Operations

Create or insert operations add new documents to a collection. If the collection does not currently exist, insert operations will create the collection.

MongoDB provides the following methods to insert documents into a collection:

In MongoDB, insert operations target a single collection. All write operations in MongoDB are atomic on the level of a single document.

For examples, see Insert Documents.

Read Operations

Read operations retrieves documents from a collection; i.e. queries a collection for documents. MongoDB provides the following methods to read documents from a collection:

You can specify query filters or criteria that identify the documents to return.

For examples, see:

Update Operations

Update operations modify existing documents in a collection. MongoDB provides the following methods to update documents of a collection:

In MongoDB, update operations target a single collection. All write operations in MongoDB are atomic on the level of a single document.

You can specify criteria, or filters, that identify the documents to update. These filters use the same syntax as read operations.

For examples, see Update Documents.

Delete Operations

Delete operations remove documents from a collection. MongoDB provides the following methods to delete documents of a collection:

In MongoDB, delete operations target a single collection. All write operations in MongoDB are atomic on the level of a single document.

You can specify criteria, or filters, that identify the documents to remove. These filters use the same syntax as read operations.

For examples, see Delete Documents.

Bulk Write

MongoDB provides the ability to perform write operations in bulk. For details, see Bulk Write Operations.

5.MongoDB CRUD Operations-官方文档摘录的更多相关文章

  1. Cocos Creator 加载和切换场景(官方文档摘录)

    Cocos Creator 加载和切换场景(官方文档摘录) 在 Cocos Creator 中,我们使用场景文件名( 可以不包含扩展名)来索引指代场景.并通过以下接口进行加载和切换操作: cc.dir ...

  2. ng的概念层次(官方文档摘录)

    官方文档是这么说的: You write Angular applications by: composing HTML templates with Angularized markup, writ ...

  3. Cocos Creator 使用计时器(官方文档摘录)

    在 Cocos Creator 中,我们为组件提供了方便的计时器,这个计时器源自于 Cocos2d-x 中的 cc.Scheduler,我们将它保留在了 Cocos Creator 中并适配了基于组件 ...

  4. Cocos Creator 生命周期回调(官方文档摘录)

    Cocos Creator 为组件脚本提供了生命周期的回调函数.用户通过定义特定的函数回调在特定的时期编写相关 脚本.目前提供给用户的声明周期回调函数有: onLoad start update la ...

  5. angular 模板语法(官方文档摘录)

    https://angular.cn/guide/template-syntax {{}} 和"" 如果嵌套,{{}}里面求完值,""就是原意 <h3&g ...

  6. Qt元类型(MetaType)注册入门(附一些官方文档的关键摘录)

    昨天调试项目时,突然发现如下消息: QObject::connect: Cannot queue arguments of type 'ERROR_LEVEL' (Make sure 'ERROR_L ...

  7. Spring Data Commons 官方文档学习

    Spring Data Commons 官方文档学习   -by LarryZeal Version 1.12.6.Release, 2017-07-27 为知笔记版本在这里,带格式. Table o ...

  8. Spark官方文档 - 中文翻译

    Spark官方文档 - 中文翻译 Spark版本:1.6.0 转载请注明出处:http://www.cnblogs.com/BYRans/ 1 概述(Overview) 2 引入Spark(Linki ...

  9. Spark SQL 官方文档-中文翻译

    Spark SQL 官方文档-中文翻译 Spark版本:Spark 1.5.2 转载请注明出处:http://www.cnblogs.com/BYRans/ 1 概述(Overview) 2 Data ...

  10. Spark Streaming官方文档学习--上

    官方文档地址:http://spark.apache.org/docs/latest/streaming-programming-guide.html Spark Streaming是spark ap ...

随机推荐

  1. [k8s]监控

    监控架构 参考 https://github.com/DataDog/the-monitor/blob/master/kubernetes/how-to-collect-and-graph-kuber ...

  2. iOS开发多线程篇 04 —线程间的通信

    iOS开发多线程篇—线程间的通信 一.简单说明 线程间通信:在1个进程中,线程往往不是孤立存在的,多个线程之间需要经常进行通信 线程间通信的体现 1个线程传递数据给另1个线程 在1个线程中执行完特定任 ...

  3. CCNA2.0笔记_NAT

    NAT:园区网内的PC是私有地址,整个园区网共享一个公有IP,如果园区网内的PC不做NAT,那么在发数据包给外网的时候会出现传输问题 NAT的原理:改变IP包头,使目的地址.源地址或两个地址在包头中被 ...

  4. Jquery学习笔记(7)--京东导航菜单

    主要是几个模块的浮动和定位不好处理,另外还缺少右侧导航,及幻灯片. <!DOCTYPE html> <html lang="en"> <head> ...

  5. js移除某一类的div

    (转载)Javascript removeChild()不能删除全部子节点的解决办法   在Javascript中,只提供了一种删除节点的方法:removeChild().removeChild() ...

  6. 第二百三十八节,Bootstrap输入框和导航组件

    Bootstrap输入框和导航组件 学习要点: 1.输入框组件 2.导航组件 3.导航条组件 本节课我们主要学习一下Bootstrap的两个个组件功能:输入框组件和导航导航条组件. 一.输入框组件 文 ...

  7. 嵌入式驱动开发之spi---spi串口通信调试

    一. 概念 SPI是 Serial Peripheral Interface(串型外部接口)的缩写.SPI接口有4根PIN脚,分别是:          * SPICLK     : 用于传输数据的同 ...

  8. linux程序设计——主机字节序和网络字节序(第十五章)

    15.2.10    主机字节序和网络字节序 当在基于intel处理器的linux机器上执行新版本号的server和客户程序时,能够用netstat命令查看网络连接状况.它显示了客户/server连接 ...

  9. win7(64位)+vs2008配置Directshow

    参考链接:http://zhuyanfeng.com/archives/1663 PC环境:win7 64bit + vs2008 1.下载64位的win7 SDK2.安装过程中遇到错误(必须要卸载v ...

  10. 更改Ubuntu的默认开机启动项

    终端下: sudo vim /etc/default/grub 修改以下红色语句即可,注意是从0开始: GRUB_DEFAULT=5 #GRUB_HIDDEN_TIMEOUT= GRUB_HIDDEN ...