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?
version()
anddb.version()
in themongo
shell? – Stennie Sep 26 '18 at 22:00