I am making a Todo List website with node.js and using mongoose database. In this database I have two two collecions,
- user colllection having schema like this : const userSchema = new mongoose.Schema({ email: String, password: String, googleId: String });
- list collection to store list items having schema like : const itemsSchema = { name: String } How to ensure that if a user is logged in then the item it enters in todolist belogs to him/her only ?