BlinkDB Logo blinkDB

upsertMany()

Inserts the items into the table, or updates them if items with the given primary keys already exist.

Returns the ids of the inserted/updated items.

const [aliceId, bobId, charlieId] = await upsertMany(userTable, [
  { id: uuid(), name: "Alice", age: 23 },
  { id: "existing-bob-uuid", name: "Bob", age: 45 },
  { id: uuid(), name: "Charlie", age: 34 }
]);
ParameterDescription
tableThe table created by createTable() .
itemsThe items to insert/update.