I've got a Firestore database in Firebase for my Angular web app. Now I'm trying to create new documents within my collection "users". I know how to create those but only with simple fields ("mail, nickname and userID"). I also want to add a subcollection "routes" to this document but I don't know how. There will be documents within this subcollection.
Here is a photo of my DB in Firebase: https://i.stack.imgur.com/3nZMn.png
This is the function I use to create a new user in this database. It is working but the subcollection is missing.
create_new_User(docID, email, nickname, userID) {
return this.fireservices.collection('users').doc(docID).set({
mail: email,
nickname: nickname,
userID: userID
});
}
Has someone any ideas to fix this problem?