MCPcopy Create free account
hub / github.com/FoundationDB/fdb-document-layer / toPredicate

Method toPredicate

src/ExtOperator.actor.cpp:54–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52struct ExtValueOperatorNin {
53 static const char* name;
54 static Reference<IPredicate> toPredicate(std::string const& unencoded_path, bson::BSONElement const& element) {
55 std::vector<Reference<IPredicate>> terms;
56 // We can do this *despite* Mongo array semantics, because those semantics inconsistently treat a
57 // $ne like a $not: {path: {$in: element}}.
58 for (auto it = element.Obj().begin(); it.more();) {
59 auto el = it.next();
60 terms.push_back(ref(new NotPredicate(eq_predicate(el, unencoded_path))));
61 }
62 return ref(new AndPredicate(terms));
63 }
64};
65REGISTER_VALUE_OPERATOR(ExtValueOperatorNin, "$nin");
66

Callers

nothing calls this directly

Calls 3

refFunction · 0.85
eq_predicateFunction · 0.85
beginMethod · 0.80

Tested by

no test coverage detected