db.coll.findAndModify({
query:{x:"ggg"},
update:{$set:{"x":"gggg"}},
fields:{"x":1},
new:true,
upsert:true
})

query:查询语句

update:(和remove必须有一个,也只能存在一个)

fields:需要显示的字段

new:true:返回更新之后的值  false:返回更新前的值

upsert: 查询结果不存在是否新增

最新文章

  1. Why is applicationhost.config still being added to source control even thought it's in gitignore
  2. 操作无效:已关闭 Lob。 ERRORCODE=-4470, SQLSTATE=null
  3. HQL: Hibernate查询语言
  4. repeater 结合checkbox批量删除
  5. 利用程序将.jrxml导出为.jasper文件并用PDF显示(2)
  6. Oracle游标动态赋值
  7. 优秀的 Android Studio 插件
  8. 驱动: oops
  9. Asycn/Await 异步编程初窥
  10. apache 配置
  11. vue-axios基本用法
  12. vue3+typescript引入外部文件
  13. [Nuget]Nuget命令行工具安装
  14. Android版本号列表
  15. windows docker常用命令
  16. Implicit super constructor Object() is undefined for default constructor. Must define an explicit constructor
  17. leetcode-algorithms-21 Merge Two Sorted Lists
  18. JNI由浅入深_6_简单对象的应用
  19. (转)Dubbo扩展点实现细节
  20. 【Python】词典

热门文章

  1. java web 程序---登陆验证4个页面
  2. crontab 定时任务设置
  3. 使用GET方式提交的表单遇到的问题
  4. Visual Studio Online 创建项目
  5. AOP 动态织入的.NET实现
  6. 为什么KVM计算机点无故重启?
  7. python第三方库推荐 - dateutil
  8. 手把手教你使用node-inspector调试nodejs
  9. 全景之HDR
  10. NSTimer类的使用