← Main page

Mongodb

Count documents

db.collection_name.countDocuments({ field_name: true });

Get distinct values of a field

db.collection_name.distinct('field_name', { another_field_name: true }).sort();