Below, you can see the output from these two logs. The first clearly shows the full object with the property I\'m trying to access, but on the very next line of code, I can\
I've just had the same issue with a document loaded from MongoDB using Mongoose.
Turned out that i'm using the property find() to return just one object, so i changed find() to findOne() and everything worked for me.
Solution (if you're using Mongoose): Make sure to return one object only, so you can parse its object.id or it will be treated as an array so you need to acces it like that object[0].id.