The mongoose documentation demonstrates how to disable the versionKey as follows:
new Schema({...}, { versionKey: false });
However, in @types/mongoose it is represented as a string.
versionKey?: string;
An error message I encountered reads:
[ts] Argument of type '{ versionKey: boolean; }' is not assignable to parameter of type 'SchemaOptions'. Types of property 'versionKey' are incompatible. Type 'boolean' is not assignable to type 'string'. (property) versionKey: boolean
How can I disable versionKey without encountering this error?