I'm attempting to insert a document from a Firebase cloud function into Firestore, but it's not functioning as expected. Here's my code snippet:
import * as admin from "firebase-admin"
import * as functions from "firebase-functions"
admin.initializeApp()
exports.findDeck = functions.https.onCall((data: { deckId: string }) => {
admin.firestore().collection("messages").add({original: "for me"})
return requestDeck.findDeck(data.deckId)
})
It appears to be a straightforward task. I am referencing an example from:
I have also consulted the Firestore documentation for Node.js and attempted using set
instead of add
. However, these changes do not produce any results or errors.