• 2025-11-18
mongodb中怎么统计记录数?

答案是使用countDocuments()或estimatedDocumentCount()方法。需精确统计时用countDocuments(),支持条件查询;需快速估算总数时用estimatedDo......

11