When gathering user information and favorite foods in a form, I'd like the favorite food data to be nested under the 'users' collection as Likes:
const sendPosts = (e) => {
e.preventDefault()
db.collection("users").add({
//here I add the user details
name: "userName",
lastName: "userLastName",
//can I also add a sub-collection like this after "lastName"
collection("favFood").add({
favDrink: "userDrink",
favDessert: "userDesert",
})
})
}
Is it possible to achieve this structure, or is there a more straightforward way?