How do I update an array item at a given index with the Update function?

Hey !

I believe you would still need to read the data before updating & use a custom function to update the array. I used this one ReplaceAtIndex as an UDF.

Query(
  Lambda(
    ['docRef', 'index'],
    Update(
      Var('docRef'),
      Let(
        {
          currentBar: Select(['data', 'bar'], Get(Var('docRef')))
        },
        {
          bar: Call(Function('ReplaceAtIndex'), [Var('currentBar'), Var('index'), { baz: true }])
        }
      )
    )
)