Skip to main content

remove_at

Function remove_at 

Source
pub fn remove_at<T>(idx: impl IntoExpr<usize>) -> Assignment<List<T>>
Expand description

Drop the element at the given index from an ordered collection field.

Takes a usize-typed index and produces an assignment for List<T> that removes the element at that position. Out-of-bounds indices are a no-op rather than an error โ€” per-row failure semantics on a bulk update are rarely useful.

Atomic against the existing column value. Backends that advertise Capability::vec_remove_at support this โ€” currently PostgreSQL only; other backends return an error.

ยงExamples

โ“˜
user.update()
    .tags(stmt::remove_at(0))
    .exec(&mut db)
    .await?;