0

i need to update a field in some documents of my users collection, after another document changes, only if those users meet a required criteria. I know i can do querys filtering for the criteria but this would download the documents (i dont need this) i just need to update the field changed in the first document. is this even posible or should i look for another aproach?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441

1 Answers1

1

You must know the full path of every document in order to update it. There is equivalent of SQL's "update where" type queries that will both query and update the matching rows. You will need to query first, iterate the results, and update what you need from that set.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441