I'm successfully getting a document from my Mongo DB, but everything in that document is showing undefined. Here's an example:
...
const user = await UserModel.findById(user_id).exec(); //Getting user normally
console.log(user); // Shows the object normally with the "push_subscriptions" property
console.log(user.push_subscriptions); // Shows undefined
console.log(user.email); //Shows the email normally
...
Here's the screenshot of console:
Here is the "push_subscriptions" part of User's schema:
...
push_subscriptions: {
type: Array,
},
...