Я получаю сообщение об ошибке синтаксического анализа: неожиданный токен
Я новичок в узле js и не знаю, что это значит?
Я рассмотрел различные другие вопросы и ответы о переполнении стека, ноне могу найти ничего, что может помочь.
(Я взял код прямо с сайта пожарного магазина и изменил значения на свои.)
exports.sendMessageNotificationFireStore = functions.firestore
.document('/user-messages-notification/{toId}/{fromId}/{message}')
.onWrite((snap, context) => {
var db = admin.firestore();
var toId = context.params.toId;
var fromId = context.params.fromId;
console.log('toId is' + toId + 'fromId is' + fromId);
console.log('toId is' + toId + 'and they recieved a message from fromId who is' + fromId);
//start of firestore code
var cityRef = db.collection('Users').doc(toId);
var getDoc = cityRef.get()
.then(doc => {
if (!doc.exists) {
return console.log('No such document!');
} else {
return console.log('Document data:', doc.data());
}
})
.catch(err => {
return console.log('Error getting document', err);
});
// perform desired operations ...
});//end on firestore code
});