Make the MongoDB docs better! We value your opinion. Share your feedback for a chance to win $100.
Click here >
Docs Menu
Docs Home
/ /
Node.js SDK

CRUD - Node.js SDK

A write transaction is a function that modifies objects in a realm. Write transactions let you create, modify, or delete Realm objects. They handle operations in a single, idempotent update. A transaction is all or nothing. Either:

  • Todas las operaciones en la transacción tienen éxito, o;

  • If any operation fails, none of the operations complete.

Importante

Cada operación de escritura debe ocurrir en una transacción de escritura.

Las transacciones de escritura son funciones de devolución de llamada que se pasan a una instancia de dominio. Para ver ejemplos de operaciones de escritura específicas, consulte CRUD - SDK de Node.js.

A given realm only processes one write transaction at a time. When you make a write transaction, the realm adds the transaction to a queue. The realm evaluates each transaction in the order it arrived.

Después de procesar una transacción, Realm la confirma o la cancela:

  • After a commit, the realm applies all operations in the transaction. Once applied, the realm automatically updates live queries. It notifies listeners of created, modified, and deleted objects.

    Nota

    When using Sync, the SDK also queues the changes to send to Atlas App Services. The SDK sends these changes when a network is available.

  • Realm no aplica ninguna operación en una transacción cancelada. Realm cancela una transacción si una operación falla o no es válida.

Volver

Datos geoespaciales

En esta página