Python 如何使用$count?

Python 如何使用$count?,python,mongodb,count,Python,Mongodb,Count,据说mongodb文档使用了db.collection.aggregate([{$count:“timers”}])来计算集合“timers”中有多少文档,但它说$count是无效语法。有办法解决吗?用引号括起来“$count” 代码现在运行,但它现在给出,而不仅仅是一个number@Archiblade打印(列表(光标))读取- db.collection.aggregate([{ "$count" : "timers"}])

据说mongodb文档使用了
db.collection.aggregate([{$count:“timers”}])
来计算集合“timers”中有多少文档,但它说
$count
是无效语法。有办法解决吗?

用引号括起来
“$count”


代码现在运行,但它现在给出,而不仅仅是一个number@Archiblade
打印(列表(光标))
读取-
db.collection.aggregate([{ "$count" : "timers"}])