2

I'm trying creating indexes on a MongoDB collection and while they are correctly created and they work (I can see the index in the executionStats), the output of the getIndexes() function is an empty array:

> db.shopOrder.createIndex({'userId': 1});
{
    "createdCollectionAutomatically" : false,
    "numIndexesBefore" : 2,
    "numIndexesAfter" : 3,
    "ok" : 1
}
> db.shopOrder.getIndexes();
[ ]

I'm using MongoDB 3.6, why does this happen?

Matteo Riva
  • 121
  • 4

0 Answers0