ACID Properties and Mongo Terms
ACID property supports is the main restrict. These ACID principles determine transactions principles.
- Atomicity: – it means if any transaction scope fails entire transaction fails.
- Consistency: – it states that entire rules of the transaction must correspond as long as transaction execution. It means input and output of transaction must be consistent. Data is in a consistent state when a transaction starts and when it ends.
- For example, in an application that transfers funds from one account to another, the consistency property ensures that the total value of funds in both the accounts is the same at the start and end of each transaction.
- Isolation: – Each transaction scope must have distinct rules means one transaction shouldn’t affect to another one by its own rule. The intermediate state of a transaction is invisible to other transactions. As a result, transactions that run concurrently appear to be serialized. For example, in an application that transfers funds from one account to another, the isolation property ensures that another transaction sees the transferred funds in one account or the other, but not in both, nor in neither.
- Durability: – If any part of the transaction violates entire operations could be started over. After a transaction successfully completes, changes to data persist and are not undone, even in the event of a system failure. For example, in an application that transfers funds from one account to another, the durability property ensures that the changes made to each account will not be reversed.
Main terms in Mongo DB corresponds to CRUD
- Create à Insert: – is insert a document into a collection.
- Readà Find: – query the collection and find the documents
- Updateà Update: – by using this you can update the whole document or any specific ones.
- Delete à Remove: – by using this you can remove the single or whole document.
- Mongo Db stores data in special JSON format or BSON(Binary JSON) or binary serialization format.
Supported data Types ex like double string object and rest are present on this link read from this.
- Above are BSON data type which has identifier and number associated with this the $type operator to query documents by BSON type.
Above query return from date field for each document, it is a type of date else no result set completely.