Well I wanna know how I can fetch all indexes from a specific collection of mongodb.
I trying with listIndexes
, indexes
and indexInformation
, but these methods only give me empty values(array and object), but if I execute db.getCollection('truck').getIndexes()
on mongo terminal, this give me all indexes.
I think maybe this is a bug, but I don't find any information about this, so let me show my examples and a screenshot from "Robo 3T".
await connection.collection('truck').indexes() // returns []
await connection.collection('truck').listIndexes().toArray() // returns []
await connection.collection('truck').indexInformation() // returns {}
So... Whats happend here? why these methods not working well?
Thanks :D
P.S: I'm using mongodb
version 3.5.5
: https://github.com/mongodb/node-mongodb-native