Mongoose __v property – hide?

You can disable the “__v” attribute in your Schema definitions by setting the versionKey option to false. For example:

var widgetSchema = new Schema({ ... attributes ... }, { versionKey: false });

I don’t think you can globally disable them, but can only do it per Schema. You can read more about Schema’s options here. You might also find the Schema set method helpful.

Leave a Comment