mongoose findOne Indexes code example
Example 1: mongoose show all indexes
Order.collection.getIndexes({full: true}).then(indexes => {
console.log("indexes:", indexes);
// ...
}).catch(console.error);
Example 2: mongoose max record
const maxQuery = Goods.find({}).sort({ price: -1 }).limit(1).then(goods => goods[0].price);