MongoDB - MongoDB CRUD Operations
内容导读
互联网集市收集整理的这篇技术教程文章主要介绍了MongoDB - MongoDB CRUD Operations,小编现在分享给大家,供广大互联网技能从业者学习和参考。文章包含2004字,纯文字阅读大概需要3分钟。
内容图文
![MongoDB - MongoDB CRUD Operations](/upload/InfoBanner/zyjiaocheng/473/3d80d8cfa4434b27bb6263f5cc9a7293.jpg)
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:
- db.collection.find()
You can specify query filters or criteria that identify the documents to return.
For examples, see Query Documents.
Update Operations
Update operations modify existing documents in a collection. MongoDB provides the following methods to update documents of a collection:
- db.collection.update()
- db.collection.updateOne() New in version 3.2
- db.collection.updateMany() New in version 3.2
- db.collection.replaceOne() New in version 3.2
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:
- db.collection.remove()
- db.collection.deleteOne() New in version 3.2
- db.collection.deleteMany() New in version 3.2
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.
MongoDB - MongoDB CRUD Operations
标签:documents evel get mat ref nts oss nal https
本文系统来源:http://www.cnblogs.com/huey/p/6120472.html
内容总结
以上是互联网集市为您收集整理的MongoDB - MongoDB CRUD Operations全部内容,希望文章能够帮你解决MongoDB - MongoDB CRUD Operations所遇到的程序开发问题。 如果觉得互联网集市技术教程内容还不错,欢迎将互联网集市网站推荐给程序员好友。
内容备注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 gblab@vip.qq.com 举报,一经查实,本站将立刻删除。
内容手机端
扫描二维码推送至手机访问。