Mongodb 在mongoose中使用映射方案类型时出错

Mongodb 在mongoose中使用映射方案类型时出错,mongodb,mongoose,typeerror,mongoose-schema,mongoose-models,Mongodb,Mongoose,Typeerror,Mongoose Schema,Mongoose Models,我已经这样定义了我的猫鼬模式 export const DIDSchema: mongoose.Schema = new Schema({ socialMediaHandles: { type: Map, of: String } }); 但是当我试图编译代码时,我得到了如下错误 类型错误:未定义类型映射atsocialMediaHandles 你试过嵌套模式吗?您只能使用引用或数组进行嵌套。您正在运行什么版本的Mongoose?这方面有什么

我已经这样定义了我的猫鼬模式

export const DIDSchema: mongoose.Schema = new Schema({
    socialMediaHandles: {
        type: Map,
        of: String
      }
});
但是当我试图编译代码时,我得到了如下错误 类型错误:未定义类型
映射
at
socialMediaHandles

你试过嵌套模式吗?您只能使用引用或数组进行嵌套。

您正在运行什么版本的Mongoose?这方面有什么新闻吗?我也有同样的问题什么版本的猫鼬你有这方面的消息吗?我也有同样的问题