2016-12-07 62 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不受此錯誤的困擾?

回答