4#include "Stroika/Foundation/StroikaPreComp.h"
10using namespace Database;
11using namespace Database::Document;
18bool FilterElements::Equals::Matches (
const Database::Document::Document& doc)
const
20 if (optional<VariantValue> elt = doc.Lookup (fLHS)) {
22 optional<VariantValue> rhsValue = get_if<Value> (&fRHS);
25 rhsValue = doc.Lookup (get<FieldName> (fRHS));
27 return *elt == rhsValue;
37bool FilterElements::Matches (
const Operation& op,
const Database::Document::Document& doc)
39 if (
auto ei = get_if<Equals> (&op)) {
40 return ei->Matches (doc);
51bool Filter::Matches (
const Database::Document::Document& doc)
const
54 if (not FilterElements::Matches (op, doc)) {
#define AssertNotReached()
variant< Equals > Operation