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
It will complain about numerous things. For example, "Property 'unique' does not exist on type 'IndexDirection'."
and "Property 'unique' does not exist on type '1'"
Prerequisites
Mongoose version
5.11.0 through today
Node.js version
not pertinent
MongoDB server version
not pertinent
Typescript version (if applicable)
not pertinent
Description
Hi. The docs and code (see below) for
schema.prototype.issues
say that the result should be an array of [Index Definition, Index Options] pairs.But the type definition shows that it returns an array of
[IndexDefinition]
.indexes(): Array<IndexDefinition>;
I think it should be
indexes(): Array<[IndexDefinition, IndexOptions]>
.Code references:
return getIndexes(this);
indexes.push([field, options]);
Steps to Reproduce
Try writing the example plugin in Typescript.
It will complain about numerous things. For example, "Property 'unique' does not exist on type 'IndexDirection'."
and "Property 'unique' does not exist on type '1'"
This makes Typescript happy.
It would be nice if that were unnecessary.
Thank you!
Expected Behavior
The following does not generate complaints in TypeScript.
The text was updated successfully, but these errors were encountered: