猫鼬 schemaOption versionKey

mongoose schemaOption versionKey

在 mongoose 文档中,他们向我们展示了像这样禁用 versionKey:

new Schema({..}, { versionKey: false });

但在@types/mongoose中它是一个字符串。

versionKey?: string;

我收到这个错误:

[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

我如何禁用 versionKey 而不被这个错误烦扰?

这是@types/mongoose的问题。

I submitted a correction.