2016-12-07 61 views
0

在他们向我们展示禁用versionKey这样的猫鼬文档:猫鼬schemaOption versionKey

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

但在@类型/猫鼬它是一个字符串。

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不受此错误的困扰?

回答