1.

What do you mean by Transactions?

Answer»

A transaction is a logical unit of processing in a database that includes one or more database operations, which can be read or write operations. Transactions PROVIDE a useful feature in MongoDB to ensure consistency.

MongoDB provides two APIs to use transactions. 

  • Core API: It is a SIMILAR syntax to RELATIONAL databases (e.g., start_transaction and commit_transaction)
  • Call-back API: This is the recommended approach to using transactions. It starts a transaction, executes the specified operations, and commits (or aborts on the error). It ALSO automatically incorporates error handling logic for "TransientTransactionError" and"UnknownTransactionCommitResult".


Discussion

No Comment Found