我有 2,000,000 条记录的集合
> db.events.count(); ?
2000000
Run Code Online (Sandbox Code Playgroud)
我使用 golang mongodb 客户端连接到数据库
> db.events.count(); ?
2000000
Run Code Online (Sandbox Code Playgroud)
但是该程序仅检索大约 600,000 条记录,而不是每次我运行该程序时检索 2,000,000 条记录。
$ go run main.go
done
count = 605426
nErrors = 0
2020/09/18 11:23:43 End: retrive db from mongo and publish to kafka took 10.080603336s
Run Code Online (Sandbox Code Playgroud)
我不知道为什么?我想检索所有 2,000,000 条记录。谢谢你的帮助。