Search code examples
firebasegoogle-cloud-firestorefirebase-console

How to create Firestore document with array of objects in Firebase console?


How can one create a document in Firestore using the Firebase console that is an array of objects? Such as:

myarray: [
  {hello: "world"}
]

I tried the following:

enter image description here

But this is the result:

enter image description here


Solution

  • It must be a bug, i tried my self and got same result. But i found a workaround.

    First create the collection and document first and click save.

    then click +ADD FIELD and only add your array myarray

    lastly click the + button on myarray and add your objects.

    Basically do it one by one.