What I am trying to achieve is very simple. I need to create a user entry in the database only if it doesn\'t exist.
The app flow:
this.db.doc('users/' + uid).set({username: Santa}, {merge: true}) It should merge and not replace. Fields omitted will remain untouched. https://firebase.google.com/docs/reference/js/firebase.firestore.DocumentReference#set