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

Method toPredicate

src/ExtOperator.actor.cpp:173–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171struct ExtValueOperatorAll {
172 static const char* name;
173 static Reference<IPredicate> toPredicate(std::string const& unencoded_path, bson::BSONElement const& element) {
174 std::vector<Reference<IPredicate>> terms;
175 if (element.Array().size() == 0) {
176 return ref(new NonePredicate());
177 } else {
178 for (auto e : element.Array()) {
179 if (e.isABSONObj() && e.Obj().hasField("$elemMatch")) {
180 terms.push_back(valueQueryToPredicate(e.Obj(), unencoded_path));
181 } else {
182 terms.push_back(eq_predicate(e, unencoded_path));
183 }
184 }
185 return ref(new AndPredicate(terms));
186 }
187 }
188};
189REGISTER_VALUE_OPERATOR(ExtValueOperatorAll, "$all");
190

Callers

nothing calls this directly

Calls 4

refFunction · 0.85
valueQueryToPredicateFunction · 0.85
eq_predicateFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected