【发布时间】:2015-01-29 11:34:27
【问题描述】:
我很肯定我弄错了,但这是我的问题:
我需要一个到 mongo 的连接池,我这样创建:
mongo::ScopedDbConnection connectionPool("localhost");
然后在每个线程上,我都会这样做:
mongo::DBClientConnection c(connectionPool.get()); <-- is this even right?
接下来我需要运行
c.runCommand()
并返回连接:
connectionPool.done();
我这样做对吗?
感谢大家的帮助!
【问题讨论】:
-
你让它工作了吗?如果没有,您是否尝试在这里询问? groups.google.com/forum/#!forum/mongodb-user
标签: c++ mongodb connection pool