1

I mean how can I get an array in Firestore? enter image description here

For example, when I have a simple field I enter it with [(ngModel)] ="proyecto.titulo" but in this case, how do I enter the data in an array?

1
  • 1
    I am interested to know aswell Commented Dec 26, 2017 at 8:57

1 Answer 1

1

If you want to save an array you can write db.doc("documentName.etiquetas").set(["tag1", "tag2", "tag2"])

this will end up as the structure you want.

However, it's better to save it as a map with index 0,1,2,.... Because in that case you can directly reference and update the element. Eg. db.doc("documentName.etiquetas.0").set("new tag1")

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.