码迷,mamicode.com
首页 > 数据库 > 详细

MongoDB - MongoDB CRUD Operations

时间:2016-12-01 07:40:30      阅读:264      评论:0      收藏:0      [点我收藏+]

标签:documents   evel   get   mat   ref   nts   oss   nal   https   

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 Query Documents.

 

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.

 

MongoDB - MongoDB CRUD Operations

标签:documents   evel   get   mat   ref   nts   oss   nal   https   

原文地址:http://www.cnblogs.com/huey/p/6120472.html

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