I am looking to save my user data in my database under the uid that is created when they register. With the stock code in the Firebase docs you can simply do the following:
firebase.database().ref('users/' + userId).set({
username: name,
email: email
});
How can I save data under a predetermined child node using EmberFire? When I go to save the data it is generating the id automatically and when I attempt to add the uid to the model call it obviously won't work because that model doesn't exist.
This code creates a new id as expected:
var newAuth = this.store.createRecord('user', {
username: name,
email: email
});
newAuth.save().catch(e => {
console.log(e.errors);
});
This code fails because the model doesn't exist:
var newAuth = this.store.createRecord('user/' + this.get('session.uid'), {
username: name,
email: email
});
newAuth.save().catch(e => {
console.log(e.errors);
});
Is there a way to accomplish the latter in EmberFire?