#Update nested field in composite types

2 messages · Page 1 of 1 (latest)

rustic oasis
#

I have a deeply nested structure. It has to be this way.

I want to update a single field at the end of the nested tree structure. How do I accomplish this?

rustic oasis
#

This is the only viable solution I've found but seems very verbose:

It seems a bit verbose:

game_players:{
                  update:{
                    "0":{
                      upsert:{
                        update:{
                          proposals:{
                            update:{
                              "1":{
                                push: {
                                  select_phase_start: {...select_phase_start, chatIndex: data.chat.length, log_time, propNumber},
                                  vote_mades: {}
                                }
                              }
                            }
                          }
                        },
                        set:{
                          ...game_player,
                          Color:2
                        }
                      },
                    }
                  }
                }```