Is there a way to limit update to just 1 document?

I know there will be multiple documents matching this where query, but I only want to update 1 of them at a time.
export const joinTable = async (tableId: number, seatedPlayerId: number) => {
  await db
    .update(tableSeats)
    .set({ seatedPlayerId })
    .where(and(eq(tableSeats.tableId, tableId), isNull(tableSeats.seatedPlayerId)));
};


Any ideas on how I would accomplish that? I feel like limit should potentially be an option on update
Was this page helpful?