如何在Mongoose.js模式中表示ES6映射

我正在使用ES6 Map作为“specs”属性,我已经在下面的TypeScript接口中表示了这一点:

import { IModel } from './model'; export interface IProduct extends IModel { name: string; description: string; specs: {[key: string]: string }; img: string[]; } 

不过,这似乎并不适用于mongoose模式。 之后,失败了,我试图在我的模式下面的代码,这似乎不工作:

 const ProductSchema = new Schema({ name: String, description: String, specs: [{key: String, value: String}], img: String[] }); 

如果有人能帮我找出正确的方法来做到这一点,我将非常感激。