-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Native
-
Empty show more show less
-
Not Needed
What problem are you facing?
When I use await collection.indexes(), it claims to return Document, but actually it returns an array. So it should be Document[] or something more specific like IndexDescription[]
See: https://github.com/mongodb/node-mongodb-native/blob/4.1/src/collection.ts#L1193
What driver and relevant dependency versions are you using?
mongodb 4.1
Steps to reproduce?
Try to use for(const index of await collection.indexes()) in a TypeScript project.
You will get the error: TS2488: Type 'Document' must have a '[Symbol.iterator]()' method that returns an iterator.