01/10/2018, 00:06
Mọi người cho mình hỏi sự khác nhau giữa count() and find().count() trong MongoDB
Mình đang gặp vấn đề với hiệu suất của count trong mongodb.
dùng cái nào thì tốt hơn , và có cách nào tốt hơn 2 cách trên ko ?
Bài liên quan
db.collection.count() without parameters counts all documents in a collection.
db.collection.find() without parameters matches all documents in a collection, and appending count() counts them, so there is no difference.
Thanks Đỗ Trung Quân đã reply