这里没什么好说的,直接贴文了

MongoDB provides the following methods for updating documents in a collection:

db.collection.updateOne()

Updates at most a single document that match a specified filter even though multiple documents may match the specified filter.

New in version 3.2.

db.collection.updateMany()

Update all documents that match a specified filter.

New in version 3.2.

db.collection.replaceOne()

Replaces at most a single document that match a specified filter even though multiple documents may match the specified filter.

New in version 3.2.

db.collection.update()

Either updates or replaces a single document that match a specified filter or updates all documents that match a specified filter.

By default, the db.collection.update() method updates a singledocument. To update multiple documents, use the multi option.

Additional Methods

The following methods can also update documents from a collection:

See the individual reference pages for the methods for more information and examples.

16.Update Methods-官方文档摘录的更多相关文章

  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. micropython1.16官方文档转PDF

    折腾了一天,终于把micropython1.16的官方文档给转成了pdf格式. 不过转换成PDF格式以后存在两点问题: 1.PDF文档有些地方的排版中有些行距没有调整好: 2.使用latex编译tex ...

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

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

  8. Spring 4 官方文档学习(十一)Web MVC 框架

    介绍Spring Web MVC 框架 Spring Web MVC的特性 其他MVC实现的可插拔性 DispatcherServlet 在WebApplicationContext中的特殊的bean ...

  9. 【翻译】Django Channels 官方文档 -- Tutorial

    Django Channels 官方文档 https://channels.readthedocs.io/en/latest/index.html 前言: 最近课程设计需要用到 WebSocket,而 ...

  10. hbase官方文档(转)

    FROM:http://www.just4e.com/hbase.html Apache HBase™ 参考指南  HBase 官方文档中文版 Copyright © 2012 Apache Soft ...

随机推荐

  1. CodeForces 459D Pashmak and Parmida's problem

    Pashmak and Parmida's problem Time Limit:3000MS     Memory Limit:262144KB     64bit IO Format:%I64d ...

  2. CodeForces 1A Theatre Square

    A - Theatre Square Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u ...

  3. Okra框架(三) 搭建HTTP服务器

    Okra通过封装成熟高效的框架以简化应用程序服务器构建的过程.上一篇介绍了使用Okra快速搭建Socket服务器. 本篇承接上一篇,介绍快速搭建简单高性能的Http服务器. 这里需要说明一下Okra框 ...

  4. alsamixer 在音频子系统的使用

    alsamixer是Linux 音频架构ALSA工具的其中一个,用于配置音频的各个参数. alsamixer是基于文本下的图形界面的,可以通过键盘的上下键,左右键等,很方便地设置需要的音量,开关某个s ...

  5. postgresql data数据目录路径迁移

    默认的数据库路径是/var/lib/pgsql/9.x/data 将现有的数据库文件全部拷贝到新的数据库路径下,然后重启 新建一个路径作为新的数据库数据路径,假如是/home/data sudo mk ...

  6. C++ 构造函数的对象初始化列表

    //构造函数的对象初始化列表 #define _CRT_SECURE_NO_WARNINGS #include<iostream> using namespace std; class P ...

  7. 隐马尔科夫模型(hidden Markov model, HMM)

  8. 第二百八十一节,MySQL数据库-SQL注入和pymysql模块防止SQL注入

    MySQL数据库-SQL注入和pymysql模块防止SQL注入 SQL注入就是通过SQL语句绕开程序判断,获取到数据库的内容 下面以一个简单的程序登录SQL注入举例: 正常登录 1.数据库有一张会员表 ...

  9. 第二百八十节,MySQL数据库-外键链表之一对多,多对多

    MySQL数据库-外键链表之一对多,多对多 外键链表之一对多 外键链表:就是a表通过外键连接b表的主键,建立链表关系,需要注意的是a表外键字段类型,必须与要关联的b表的主键字段类型一致,否则无法创建索 ...

  10. javascript -- 阻止默认事件 阻止事件冒泡

    1. event.preventDefault();  -- 阻止元素的默认事件.注:a元素的点击跳转的默认事件 , button,radio等表单元素的默认事件 , div 元素没有默认事件 例: ...