码迷,mamicode.com
首页 > 其他好文 > 详细

16.Update Methods-官方文档摘录

时间:2017-08-01 12:31:06      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:replace   sim   reference   int   any   win   nal   page   god   

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

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-官方文档摘录

标签:replace   sim   reference   int   any   win   nal   page   god   

原文地址:http://www.cnblogs.com/olinux/p/7267299.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!