0
My Create method is like this
create(user: User, uuid: string): Promise<void> {
return this.db.object(`/users/${uuid}`)
.set(user)
.catch(this.handlePromiseError);
}
And my User class is like this
export class User {
public $key: string;
constructor(
public name: string,
public username: string,
public email: string,
public photo: string
) {}
}
Only when I go to record in firebase, the id becomes undefined and when I record another data it overrides the first one and erases.
https://firebase.google.com/docs/firestore/manage-data/transactions?hl=pt-br Use transactions. This should solve your problem.
– user125721