Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 574 Bytes

File metadata and controls

30 lines (21 loc) · 574 Bytes
title update()
description Tries to update given record or records by their id.

update()

Usage

import { useRepo } from 'pinia-orm'
import User from './models/User'

const userRepo = useRepo(User)

// update specific record
userRepo.update({ id: 1, age: 50 })

// update specific records
userRepo.update([{ id: 1, age: 50 }, { id: 2, age: 50 }])

// throws an warning if the record to update is not found
userRepo.update({ id: 999, age: 50 })

Typescript Declarations

function update(records: Element | Element[]): M | M[]