How can I access the "name" and "ObjectId" from this array of Objects? (Mongoose, MongoDB)
I want to access the name property. I tried doing the following but it returned undefined: Category.find() .select("-_id") .select("-__v") .then((categories) => { let creator = req.userId; console.log(categories.name) //undefined if (categories.creator === creator && categories.name === categoryName) { note .save() this…