I have been trying to push or store a FireStore array in one of my own arrays. I have tried a few versions of code, the first being this:

```
var data = [];
  db.collection('Rooms')
    .doc(code)
    .get()
    .then((docs) => data.push(docs.data()));

```

However, when I log the data variable, it comes out as an empty array. The second method I have tried is this:

```
 var [data, setData] = useState([]);
  db.collection("Rooms")
    .doc(code)
    .get()
    .then((docs) => setData(docs.data()));

```

However this method seems to setData infinitely, so it is reading into my API infinitely, which I would like to avoid. The last method I tried was this:

```
  var data = db.collection("Rooms").doc(code).get();
  console.log(data);

```

But this just returns

```
Promise {
  "_U": 0,
  "_V": 0,
  "_W": null,
  "_X": null,
}

```

Could anyone help me with this, ideally I'd like to store the data of an array called "MovieArray" inside the document, but I can't even access the document, so even if you can just help me store the data of the whole document, it would be very helpful.