function getActiveTransaction():
| undefined
| Transaction<Record<string, unknown>>
function getActiveTransaction():
| undefined
| Transaction<Record<string, unknown>>
Definiert in: packages/db/src/transactions.ts:93
Ruft die aktuell aktive Umgebungs-Transaktion ab, falls vorhanden. Wird intern von Collection-Operationen verwendet, um sich an bestehende Transaktionen anzuhängen.
| undefined | Transaction<Record<string, unknown>>
Die aktive Transaktion oder undefined, wenn keine aktiv ist.
// Check if operations will join an ambient transaction
const ambientTx = getActiveTransaction()
if (ambientTx) {
console.log('Operations will join transaction:', ambientTx.id)
}
// Check if operations will join an ambient transaction
const ambientTx = getActiveTransaction()
if (ambientTx) {
console.log('Operations will join transaction:', ambientTx.id)
}
Ihre wöchentliche Dosis JavaScript-Nachrichten. Jeden Montag kostenlos an über 100.000 Entwickler geliefert.