예제 #1
0
bool ExprMatchExpression::matches(const MatchableDocument* doc, MatchDetails* details) const {
    if (_rewriteResult && _rewriteResult->matchExpression() &&
        !_rewriteResult->matchExpression()->matches(doc, details)) {
        return false;
    }

    Document document(doc->toBSON());
    auto value = _expression->evaluate(document);
    return value.coerceToBool();
}
예제 #2
0
bool ExprMatchExpression::matches(const MatchableDocument* doc, MatchDetails* details) const {
    Document document(doc->toBSON());
    auto value = _expression->evaluate(document);
    return value.coerceToBool();
}