AdithyaSK's picture
AdithyaSK HF Staff
Add files using upload-large-folder tool
6740efe verified
|
Raw History Blame Contribute Delete
887 Bytes

Fix the following issue:

Support string initialization for map in schema

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

My project uses String for setting the type in schema of each keys like this:

username: { type: 'string', required: true }

In case of map, I just tried this style of code:

instance: {
  type: Schema.Types.Map,
  of: Schema.Types.Mixed,
  default: new Map<string, any>(),
}

This is working code. But if I use 'Map' instead of Schema.Types.Map, compiler aborts to compile.

instance: {
  type: 'Map',
  of: 'Mixed',
  default: new Map<string, any>(),
}

So, is it able to allow with setting the map type with String?

Motivation

No response

Example

No response