Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何获取返回数组的大小 .count
db.students.distinct('class_id')
此查询将返回一个数组,我如何获取此数组的大小/长度/计数?
请记住,这是 javascript 代码,因此您可以使用length.
length
db.students.distinct('class_id').length