You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
username: {unique: true, type: String}
Gives of an error since its not String (not SchemaDefinitionProperty<string>)
Also, if I would try to do something like export type SH = Omit<IUser, "username"> & Document & {username: SchemaTypeOptions<String>}, then i would get an error that
Type '{ unique: true; type: StringConstructor; }' is not assignable to type 'SchemaDefinitionProperty<SchemaTypeOptions<String>>'. Type '{ unique: true; type: StringConstructor; }' is not assignable to type 'string'
tsconfig.json is irrelevant
What is the expected behavior?
That you are able to get to SchemaTypeOptions, somehow.
What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
5.11.15
Edit:
Technically, you can access it, through the use of
But that feels like a very work around-ish way to do it. Is there a better way for this? Because i see that the type definition for the SchemaTypeOptions having a generics type there, so I assume there was intended to be a way for it?
The text was updated successfully, but these errors were encountered:
Do you want to request a feature or report a bug?
bug
What is the current behavior?
You are unable to reach the
SchemaTypeOptions
if using a pre-made interface.If the current behavior is a bug, please provide the steps to reproduce.
Also, if I would try to do something like
export type SH = Omit<IUser, "username"> & Document & {username: SchemaTypeOptions<String>}
, then i would get an error thattsconfig.json is irrelevant
What is the expected behavior?
That you are able to get to
SchemaTypeOptions
, somehow.What are the versions of Node.js, Mongoose and MongoDB you are using? Note that "latest" is not a version.
5.11.15
Edit:
Technically, you can access it, through the use of
But that feels like a very work around-ish way to do it. Is there a better way for this? Because i see that the type definition for the
SchemaTypeOptions
having a generics type there, so I assume there was intended to be a way for it?The text was updated successfully, but these errors were encountered: