Я пытаюсь обновить одно свойство в моей базе данных firebase, но возникла ошибка. Ошибка: Reference.update не удалось: первый аргумент должен быть объектом, содержащим дочерние элементы, для замены
analysis = (actionid)=>{
//check if it is't the first command
console.log('before definition of flage')
var flag=false;
console.log('hiii')
firebase.database().ref('userActions/').once ('value',(snap)=>{
console.log("iafter definition ")
snap.forEach((child)=>{
if(child.val().userID===firebase.auth().currentUser.uid && child.val().ActionID== actionid){
plus=parseInt(child.val().Repetition)+1;
console.log("before first use")
flag=true;
console.log("before first use 2")
firebase.database().ref('userActions/'+child.key).update(
Repetition=plus,
).then(() => {
console.log('inserted the update')
}).catch((error)=>{
console.log(error)
});
} })
}
).finally(()=>{
if(flag===false)
this.insertUserAction();
});
}