0
 String statusOff= "off";
    Map<String, Object> status = new HashMap<>();
    status.put("status", statusOff);
    db.collection("Users").document("terapis")
        .update(status)
        .addOnSuccessListener(new OnSuccessListener<Void>() {
           @Override
           public void onSuccess(Void aVoid) {
           }

The code is working but i have a problem, as you can see, i manually input the document id I dont know any function like whereEqualTo for update.

Is there any way to do this?

aldi nugraha
  • 105
  • 8

1 Answers1

0

If you're trying to update all documents that match some condition, that's not possible. There is no SQL-like "update where" functionality. You will have to query for each of the documents that match your condition, iterate the results, then update each document individually.

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