I'm trying:
await firebase.firestore().doc(`documents/${documentData.id}`).update({
predictionHistory: firebase.firestore.FieldValue.arrayUnion(...[predictions])
});
where predictions is an array of:
export interface PredictionHistory {
predictedAt: firebase.firestore.Timestamp;
predictionText: string;
}
But I get an error:
FirebaseError: Function FieldValue.arrayUnion() called with invalid data. Nested arrays are not supported
Any idea what I'm doing wrong?