Monday, 3 July 2017

CRUD Operations.

CRUD Operations :

MongoDB has the following CRUD Operations.

1. Create Operation.
2. Read Operation.
3. Update Operation.
4. Delete Operation.

CREATE OPERATION :

Create or Insert operation inserts or create a document into collection. If there is no collection exists, then it will create a collection and insert the document.

Inserting of documents will be done with the following ways :

1. db.collection_name.insert({});
2. db.collection_name.insertOne({});
3. db.collection_name.insertMany({});

I. insert operations target a single collection. Write operations in the MongoDB are "atomic".

Atomicity and Transaction :

Write operation on a document is always functions individually, whether it is a part of multi documents -- collection or a single document -- collection.

$isolate -- operator is used to perform "write" operation that effects multiple documents.

When a $isolate operator is performed on multiple documents, it will not effect the other processes.
  

No comments:

Post a Comment