How can i do this? I have a data stucture for each user in a user collection, I have created my own schema for the user object stored in the collection.
I want to have a favoriteMovies collection initalised into this object so that i can add movie objects inside.
Heres an example of what im trying to do :
async function signUp(email, password){
const {user} = await auth.createUserWithEmailAndPassword(email, password)
// initialise the schema for the data
const userInitialised = await db.collection('users').doc(user.uid).set(userSchemaObject(user.uid))
return userInitialised;
}
Then the schema so far:
export default function userSchemaObject(uuid){
return {
uuid,
favmovies:[]
}
}