The mongodb documentation said to use db.collection.aggregate([{$count: "timers"}])
to count how many documents are in the collection "timers", but it says that $count
is invalid syntax. Is there a way to fix?
Wrap in quotes "$count"
db.collection.aggregate([{ "$count" : "timers"}])
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.