MongoDB client pool.
Use constructor only for tests, in production the pool should be retrieved from the components via components::Mongo::GetPool() or components::MultiMongo::GetPool().
Example usage:
});
auto cursor = in_coll.Aggregate(
MakeArray(
MakeDoc("$match", MakeDoc("_id", MakeDoc("$gte", 2))),
MakeDoc("$addFields", MakeDoc("check", true)),
MakeDoc("$out", "aggregate_out")
),
);
EXPECT_FALSE(cursor);
EXPECT_EQ(2, out_coll.CountApprox());
for (const auto& doc : out_coll.Find({})) {
EXPECT_EQ(doc["_id"].As<int>(), doc["x"].As<int>() + 1);
EXPECT_TRUE(doc["check"].As<bool>());
}
}
Definition at line 37 of file pool.hpp.