?
db.batch
Combine multiple reads and writes into a single round trip. Writes run in order; reads observe prior writes.
db.batch(...ops) → [results]
Combines several operations into a single network round trip. Writes run in the order given and later reads observe the earlier writes, so you can insert a row and read it back in one call. Because every un-batched operation is its own round trip, batching is the default whenever you touch more than one row: map a list to mutations and pass them all at once instead of awaiting inside a loop.
Parameters
ops
Query | Mutation
RequiredAny table operations to run together.
Batch reads
const [vendors, orders] = await db.batch( Vendors.filter(v => v.status === 'approved'), Orders.count(o => o.status === 'pending'), );