In relational databases like Oracle if I am making a transaction: Does this have a backpoint, so that if there was a problem the changes are not made in the database? Can this be done in some way in Mongo? Are there also transactions in Mongo?
In relational databases like Oracle if I am making a transaction: Does this have a backpoint, so that if there was a problem the changes are not made in the database? Can this be done in some way in Mongo? Are there also transactions in Mongo?
In response to your question and adding a bit of theory:
Relational databases usually guarantee the ACID properties related to the reliability with which transactions are processed (both read and write). MySQL and PostgreSQL (among many more) are examples of databases that provide these properties.
What you point to is how MongoDB manages atomicity, for which I should first tell you that:
In MongoDB, a write operation is atomic at the level of a only document, even if the operation modifies multiple documents embedded in a single document.
When a single write operation modifies multiple documents, the modification of each document is atomic, but the operation as A whole is not atomic and other operations can be interspersed.
(Excerpted from the MongoDB documentation)
Therefore, MongoDB provides only one transaction in the entire document: writes are never partially applied to an inserted or updated document. The operation is atomic in the sense that it fails or succeeds, for the document as a whole. To finalize and summarize , MongoDB if it has a "backpoint", will only save the data, if the transaction was successful, if there was an error it will return to its previous state (Backpoint).
They recently announced the roadmap for Mongodb 4.0 and 4.2 in which they include multidocument transactions (only for replicaSet in 4.0 and also for sharding in version 4.2). just as the relational bases do (even with a very similar syntax)
I'll leave you a couple of links in case you're interested: