So i am trying to find a user with the UserID of with the same value as the variable UserIDand once found I want to add a new child to my collection. I am unsure how to do this, I have tried using
var UserID = 123;
var userEvent = firebase.database().ref('/users').orderByChild("id").equalTo(UserID).child('Events');
var eventsData = {
testdata: 99
};
userEvent.push(eventsData);
I have tried the above however I am getting the following error message.
Unhandled Rejection (TypeError): firebase_app__WEBPACK_IMPORTED_MODULE_22__.default.database(...).ref(...).orderByChild(...).equalTo(...).child is not a function
Is there a specific way I could do this?
Below is how many users collection looks like currently
