I would like to add (or create if first) an array of map like this in my document:
videos
- 0
- url : myurl
- 1
- url : another one
by console I can do this, by I don't know how to do in code. This is my current set method:
await databaseReference.collection("${mycol}").doc("${mydoc}")
.set({
'url': url,
});
and this adds a simple string to database. How Could I do this add an item in that structure I mentioned early?
Update
And what if I have this :
videos
- 0
- url : myurl
- name : myname
- 1
- url : another one
- name : myname