Reputation: 316
I've kinda figured out that we can update just one field inside the map of the document
Like here I can add one more field to courses key, like
Map<String, Object> nested = new HashMap(){};
nested.add("sample field inside courses");
and passing it to another like
Map<String, Object> courses = new HashMap(){};
courses.add();
Q. How can I update the value of abbreviation_color
which is the last field in the above image?
Upvotes: 1
Views: 723
Reputation: 464
Here's my test document:
If I now want to update "Test2" I simply call...
yourDocumentReference.update("a.b2.c2", "New Value")
which results in this:
Edit: It does not care if it contains spaces or not, if "b2" would be "b 2" you could easily call
yourDocumentReference.update("a.b 2.c2", "New Value")
I hope I could help somebody!
Upvotes: 3