Я пытаюсь обновить документ в firestore, когда запускается тестовая функция, как показано ниже
import * as functions from 'firebase-functions';
import * as admin from 'firebase-admin'
admin.initializeApp(functions.config().firebase);
exports.test = functions.firestore.document('test/{id}').onCreate(event => {
admin.firestore().collection("testcollection").document(data.truckId)
})
но эта строка кода не работает
admin.firestore().collection("testcollection").document()
выдает ошибку, что функция документа не существует
EDIT
Я использую следующий код
admin.firestore().doc(`anothercollection/${data.id}`)
.get().then((result)=>{
});
работает нормально, но при использовании следующей команды для развертывания функции
firebase deploy --only functions
Я получаю следующую ошибку
Failed to configure trigger providers/cloud.firestore/eventTypes/document.create@firestore.googleapis.com (test)
✔ functions[test(us-central1)]: Successful update operation.
Functions deploy had errors. To continue deploying other features (such as database), run:
firebase deploy --except functions
Error: Functions did not deploy properly.