Skip to main content

push

Function push 

Source
pub fn push<T>(expr: impl IntoExpr<T>) -> Assignment<List<T>>
Expand description

Append one element to an ordered collection field (e.g. Vec<scalar>).

Takes an expression of T (the element to append) and produces an assignment for List<T> (the collection). The append is atomic against the existing column value on every supported backend.

After .exec(), the instance’s field reflects the post-update value (old contents followed by the appended element).

§Examples

ⓘ
user.update()
    .tags(stmt::push("admin"))
    .exec(&mut db)
    .await?;