本文整理汇总了C++中mongo::BSONObj::getOwned方法的典型用法代码示例。如果您正苦于以下问题:C++ BSONObj::getOwned方法的具体用法?C++ BSONObj::getOwned怎么用?C++ BSONObj::getOwned使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mongo::BSONObj
的用法示例。
在下文中一共展示了BSONObj::getOwned方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: client
stitch_support_v1_update(mongo::ServiceContext::UniqueClient client,
mongo::BSONObj updateExpr,
mongo::BSONArray arrayFilters,
stitch_support_v1_matcher* matcher,
stitch_support_v1_collator* collator)
: client(std::move(client)),
opCtx(this->client->makeOperationContext()),
updateExpr(updateExpr.getOwned()),
arrayFilters(arrayFilters.getOwned()),
matcher(matcher),
updateDriver(new mongo::ExpressionContext(
opCtx.get(), collator ? collator->collator.get() : nullptr)) {
std::vector<mongo::BSONObj> arrayFilterVector;
for (auto&& filter : this->arrayFilters) {
arrayFilterVector.push_back(filter.embeddedObject());
}
this->parsedFilters = uassertStatusOK(mongo::ParsedUpdate::parseArrayFilters(
arrayFilterVector, this->opCtx.get(), collator ? collator->collator.get() : nullptr));
// Initializing the update as single-document allows document-replacement updates.
bool multi = false;
updateDriver.parse(this->updateExpr, parsedFilters, multi);
uassert(51037,
"Updates with a positional operator require a matcher object.",
matcher || !updateDriver.needMatchDetails());
}
示例2: ExpressionContext
stitch_support_v1_matcher(mongo::ServiceContext::UniqueClient client,
const mongo::BSONObj& filterBSON,
stitch_support_v1_collator* collator)
: client(std::move(client)),
opCtx(this->client->makeOperationContext()),
matcher(filterBSON.getOwned(),
new mongo::ExpressionContext(opCtx.get(),
collator ? collator->collator.get() : nullptr)){};