Home > Back-end >  What does it mean in VSCode if a module is green and if you access an object with it via dot notatio
What does it mean in VSCode if a module is green and if you access an object with it via dot notatio

Time:01-27

photo showing different colors on vscodeWhen I do

const mongoose = require('mongoose');

The mongoose immediately after const is green.

When I do mongoose.Schema.Types.ObjectId the the whole code, mongoose.Schema.Types.ObjectId is green.

But when I do mongoose.ObjectId the mongoose is green but the objectId is not. What does this mean?(see above image for photo of the same)

CodePudding user response:

The current theme you're using (Dark ) highlights classes, modules, namespaces in green. The reason for mongoose.Schema.Types.ObjectId being green is because all of the text are either a module or a namespace. The reason for mongoose in mongoose.ObjectId being green and ObjectId being not, is becuase mongoose is a module but the ObjectId in this scenario is not.

You can find the difference between mongoose.Schema.Types.ObjectId and mongoose.ObjectId in this StackOverflow post.

  •  Tags:  
  • Related