Triplit
GitHubGitHub (opens in a new tab)DiscordDiscord (opens in a new tab)
  • Welcome
  • Quick Start
  • Migrating to Triplit 1.0
  • React + Vite tutorial
  • FAQ

    • Installation
    • insert
    • update
    • delete
    • transact
    • fetch
    • fetchOne
    • fetchById
    • subscribe
    • subscribeWithPagination
    • subscribeWithExpand
    • subscribeBackground
    • Storage
    • Sync engine
    • Event listeners
    • HTTP client
    • Web Worker client
    • Options
    • Debugging
    • Overview
    • Select
    • Include
    • Where
    • Order
    • Limit
    • SubqueryOne/Many
    • syncStatus
    • Vars
    • Defining
    • Updating
    • Types
    • Relations
    • Roles and permissions
    • Installation
    • dev
    • schema
    • seed
    • snapshot
    • clear
    • roles
    • init
    • repl
    • React
    • React Native
    • Angular
    • Solid
    • Svelte
    • Tanstack Router
    • Vue
    • Browser
    • Node
    • Cloudflare Workers
    • Bun
    • Hermes (React Native)
    • Overview
    • Managed machines
    • Self-hosted deployments
    • Triplit Console
    • Quickstart
    • Sessions API
      • Clerk
      • Supabase

  • Self-hosting
  • Offline mode
  • Local development
  • Seeding a database
  • Server-side rendering
  • HTTP API
Edit this page on GitHub
Client API
`update`

update

update() updates an existing record in a collection. For example:

await client.update('employee', 'Fry', async (entity) => {
  entity.name = 'Philip J. Fry';
});

If possible, update will look at the schema you have provided to provide proper type hints for interacting with you data. If no schema is provided, all fields are treated as any.

See here for more information on data types.

`insert``delete`

MIT 2025 © Nextra.