In my below app I first get the uids of 4 players and then make a query for each username and the devices token id, that are stored separately in my database.
To save reads I stored both informations now in the same document in an array. Since I am a novice in JavaScript I don't know how to get this array now from Firestore and access the stored data in that array.
I know how to get an array from Firestore with Android/Java but this seems not to work with JavaScript.
Any help is much appreciated!
Here is my code that I use in a Cloud Function:
...
// This is where the array is stored, I now need to get the array and access the data of it
admin.firestore().collection("User").doc(uid_player_1).collection("User Info").doc("UsernameToken").get().then(queryResult =>{
// You need to get the array that is stored there. The first value (0) there is the username, the second is the device token
console.log(queryResult)
});
...
This is the log I get:
QueryDocumentSnapshot {
_fieldsProto:
{ usernameToken: { arrayValue: [Object], valueType: 'arrayValue' } },
...
Here is the collection with the document that contains the array:

console.log(queryResult)