Skip to content

FieldValue.increment not working on nested object #1956

@pjc0247

Description

@pjc0247

I have a object for balances(inventory) which contains various type of items.
however increment does not work well with this.

Here's an example

// This works
await this.ref.update({'gold': FieldValue.increment(1)});

// This does not work
await this.ref.update({
  balances: {
    [key]: FieldValue.increment(value)
  }
});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions